From f4b13b7d10836d38621fcf63efd62f8fe1a55f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20L=C3=B6fhjelm?= Date: Thu, 23 Mar 2023 12:44:38 +0200 Subject: [PATCH 1/6] Add file Dockerfile --- Dockerfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e69de29 From da7dc066c21531852f4964678dd23cc3b0753ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20L=C3=B6fhjelm?= Date: Thu, 23 Mar 2023 12:45:21 +0200 Subject: [PATCH 2/6] Ignore folder 'venv' --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2b664c8..3b50045 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ access_token.txt .idea __pycache__ +venv From 85246c42a7bd053a4048a5dbc0b2a9cf486a8299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20L=C3=B6fhjelm?= Date: Thu, 23 Mar 2023 13:11:24 +0200 Subject: [PATCH 3/6] Ignore .DS_Store --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 3b50045..30825aa 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ access_token.txt .idea __pycache__ venv +.DS_Store From 79148cb879977c4bdfdc2a8325eadce5637c601b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20L=C3=B6fhjelm?= Date: Thu, 23 Mar 2023 13:59:36 +0200 Subject: [PATCH 4/6] Add basic build logics to Dockerfile --- Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Dockerfile b/Dockerfile index e69de29..06e9c14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3 + +COPY *.py requirements.txt /app/ +WORKDIR /app + +RUN ["pip3", "install", "-r", "requirements.txt"] \ No newline at end of file From 4a8fbbd79d654bdba5833c11eebf94fd0fad3b42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20L=C3=B6fhjelm?= Date: Thu, 6 Apr 2023 09:48:14 +0300 Subject: [PATCH 5/6] Improve requirements.txt --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requirements.txt b/requirements.txt index 3a57e83..cac0150 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ paho-mqtt==1.6.1 python-dotenv==0.20.0 gtfs-realtime-bindings==0.0.7 +protobuf<=3.20.1 +requests \ No newline at end of file From 22769c9f6a6dddf951d9450db0c2cc1dcf05a4b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20L=C3=B6fhjelm?= Date: Thu, 13 Apr 2023 12:26:18 +0300 Subject: [PATCH 6/6] Add github actions --- .github/workflows/build-docker.yml | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/build-docker.yml diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml new file mode 100644 index 0000000..44ee672 --- /dev/null +++ b/.github/workflows/build-docker.yml @@ -0,0 +1,31 @@ +name: Create and deploy Docker image + +on: [push, pull_request] + +jobs: + build-develop-docker-image: + runs-on: ubuntu-latest + # Run only on develop branch + if: github.ref == 'refs/heads/develop' + steps: + - uses: actions/checkout@v3 + - name: Build and publish develop Docker image + uses: elgohr/Publish-Docker-Github-Action@v5 + with: + name: hsldevcom/transitdata-monitor-data-collector + username: ${{ secrets.TRANSITDATA_DOCKERHUB_USER }} + password: ${{ secrets.TRANSITDATA_DOCKERHUB_TOKEN }} + tags: develop + build-release-docker-image: + runs-on: ubuntu-latest + # Run only for tagged commits + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + steps: + - uses: actions/checkout@v3 + - name: Build and publish release Docker image + uses: elgohr/Publish-Docker-Github-Action@v5 + with: + name: hsldevcom/transitdata-monitor-data-collector + username: ${{ secrets.TRANSITDATA_DOCKERHUB_USER }} + password: ${{ secrets.TRANSITDATA_DOCKERHUB_TOKEN }} + tag_semver: true \ No newline at end of file