From 2d0613ba05c28d6f320a7785c20f564efeae2b94 Mon Sep 17 00:00:00 2001 From: Simon Dalvai Date: Thu, 19 Oct 2023 14:40:47 +0200 Subject: [PATCH] meteorology-eurac: use docker-build-and-push --- .github/workflows/meteorology-eurac-dc.yml | 30 +++++++++---------- .../infrastructure/docker-compose.build.yml | 8 +++++ 2 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 collectors/meteorology-eurac/infrastructure/docker-compose.build.yml diff --git a/.github/workflows/meteorology-eurac-dc.yml b/.github/workflows/meteorology-eurac-dc.yml index db67dfe..ac37d76 100644 --- a/.github/workflows/meteorology-eurac-dc.yml +++ b/.github/workflows/meteorology-eurac-dc.yml @@ -9,6 +9,8 @@ env: AWS_ACCESS_SECRET_KEY : ${{ secrets.AWS_ACCESS_SECRET_KEY }} JAVA_VERSION: 17 WORKING_DIRECTORY: collectors/meteorology-eurac + DOCKER_IMAGE: ghcr.io/${{ github.repository }}/meteorology-eurac + DOCKER_TAG: 0.0.0 jobs: @@ -30,12 +32,12 @@ jobs: - name: Authenticate to AWS EKS run: aws eks --region ${{ env.AWS_REGION }} update-kubeconfig --name ${{ env.AWS_EKS_CLUSTER_NAME }} - - name: Log in to GitHub Docker Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + # - name: Log in to GitHub Docker Registry + # uses: docker/login-action@v2 + # with: + # registry: ghcr.io + # username: ${{ github.actor }} + # password: ${{ secrets.GITHUB_TOKEN }} - name: Build libs uses: noi-techpark/github-actions/maven-build@v2 @@ -51,17 +53,15 @@ jobs: java-version: ${{ env.JAVA_VERSION }} build-command: 'mvn clean install' - # - name: Build and push images - # uses: noi-techpark/github-actions/docker-build-and-push@v2 - # with: - # working-directory: ${{ env.WORKING_DIRECTORY }}/infrastructure - # docker-username: ${{ github.actor }} - # docker-password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push images + uses: noi-techpark/github-actions/docker-build-and-push@v2 + with: + working-directory: ${{ env.WORKING_DIRECTORY }}/infrastructure + docker-username: ${{ github.actor }} + docker-password: ${{ secrets.GITHUB_TOKEN }} - name: Helm deployment working-directory: ${{ env.WORKING_DIRECTORY }} run: | RELEASETIME=`date +%s` \ - && docker build -t ghcr.io/noi-techpark/odh-v2-playground/meteorology-eurac:0.0.0 . -f infrastructure/docker/Dockerfile \ - && docker image push ghcr.io/noi-techpark/odh-v2-playground/meteorology-eurac:0.0.0 \ - && helm upgrade --install dc-meteorology-eurac ../../helm/generic-collector --values infrastructure/helm/values.yaml --set-string podAnnotations.releaseTime=$RELEASETIME \ No newline at end of file + && helm upgrade --install dc-meteorology-eurac infrastructure/helm/generic-collector --values infrastructure/helm/values.yaml --set-string podAnnotations.releaseTime=$RELEASETIME \ No newline at end of file diff --git a/collectors/meteorology-eurac/infrastructure/docker-compose.build.yml b/collectors/meteorology-eurac/infrastructure/docker-compose.build.yml new file mode 100644 index 0000000..93d36f0 --- /dev/null +++ b/collectors/meteorology-eurac/infrastructure/docker-compose.build.yml @@ -0,0 +1,8 @@ +version: "3.4" + +services: + app: + image: ${DOCKER_IMAGE}:${DOCKER_TAG} + build: + context: ../ + dockerfile: infrastructure/docker/Dockerfile