Skip to content

Commit

Permalink
cicd - skip docker-related steps when actor is dependabot (#3823)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmauduit committed Oct 28, 2022
1 parent f2bdebd commit 62a8111
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 76 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,35 +38,35 @@ jobs:
run: ../mvnw --no-transfer-progress clean verify -Pit -Dfmt.skip=true -Dadditionalparam=-Xdoclint:none

- name: Getting image tag
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
id: version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)

- name: "Building docker image"
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
working-directory: analytics/
run: ../mvnw --no-transfer-progress clean package docker:build -Pdocker,log4j-logstash,sentry-log4j -DdockerImageName=georchestra/analytics:${{ steps.version.outputs.VERSION }} -DskipTests

- name: "Logging in docker.io"
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
uses: azure/docker-login@v1
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'

- name: "Pushing latest to docker.io"
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra'
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker tag georchestra/analytics:${{ steps.version.outputs.VERSION }} georchestra/analytics:latest
docker push georchestra/analytics:latest
- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra'
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/analytics:${{ steps.version.outputs.VERSION }}
- name: "Pushing release tag to docker.io"
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra'
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/analytics:${{ steps.version.outputs.VERSION }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/atlas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,35 +38,35 @@ jobs:
run: ../mvnw --no-transfer-progress clean verify -Pit -Dfmt.skip=true -Dadditionalparam=-Xdoclint:none

- name: Getting image tag
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
id: version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)

- name: "Building docker image"
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
working-directory: atlas/
run: ../mvnw --no-transfer-progress clean package docker:build -Pdocker,log4j-logstash,sentry-log4j -DdockerImageName=georchestra/atlas:${{ steps.version.outputs.VERSION }} -DskipTests

- name: "Logging in docker.io"
uses: azure/docker-login@v1
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'

- name: "Pushing latest to docker.io"
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra'
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker tag georchestra/atlas:${{ steps.version.outputs.VERSION }} georchestra/atlas:latest
docker push georchestra/atlas:latest
- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra'
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/atlas:${{ steps.version.outputs.VERSION }}
- name: "Pushing release tag to docker.io"
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra'
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/atlas:${{ steps.version.outputs.VERSION }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/console.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,35 +51,35 @@ jobs:
run: ../mvnw verify --no-transfer-progress -Dfmt.skip=true -Dadditionalparam=-Xdoclint:none -Dskip.npm

- name: Getting image tag
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
id: version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)

- name: "Building docker image"
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
working-directory: console/
run: ../mvnw --no-transfer-progress clean package docker:build -Pdocker,log4j-logstash,sentry-log4j -DdockerImageName=georchestra/console:${{ steps.version.outputs.VERSION }} -DskipTests

- name: "Logging in docker.io"
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
uses: azure/docker-login@v1
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'

- name: "Pushing latest to docker.io"
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra'
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker tag georchestra/console:${{ steps.version.outputs.VERSION }} georchestra/console:latest
docker push georchestra/console:latest
- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra'
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/console:${{ steps.version.outputs.VERSION }}
- name: "Pushing release tag to docker.io"
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra'
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/console:${{ steps.version.outputs.VERSION }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ jobs:
run: docker build -t georchestra/database:${{ steps.version.outputs.VERSION }} .

- name: "Logging in docker.io"
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
uses: azure/docker-login@v1
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'

- name: "Pushing latest to docker.io"
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra'
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker tag georchestra/database:${{ steps.version.outputs.VERSION }} georchestra/database:latest
docker push georchestra/database:latest
- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra'
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/database:${{ steps.version.outputs.VERSION }}
- name: "Pushing release tag to docker.io"
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra'
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/database:${{ steps.version.outputs.VERSION }}
14 changes: 7 additions & 7 deletions .github/workflows/datafeeder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,41 +52,41 @@ jobs:
run: ../mvnw verify -P-all,datafeeder -DskipITs=false -DskipTests -ntp -Dfmt.skip=true -Dadditionalparam=-Xdoclint:none

- name: Getting image tag
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
id: version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)

- name: "Building docker image"
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: ./mvnw -f datafeeder/ clean package docker:build -Pdocker -DskipTests -DdockerImageName=georchestra/datafeeder:${{ steps.version.outputs.VERSION }}

- name: "Building docker image (frontend)"
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: ./mvnw -f datafeeder-ui/ clean package docker:build -Pdocker -DskipTests -DdockerImageName=georchestra/datafeeder-frontend:${{ steps.version.outputs.VERSION }}

- name: "Logging in docker.io"
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
uses: azure/docker-login@v1
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'

- name: "Pushing latest images to docker.io"
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra'
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker tag georchestra/datafeeder:${{ steps.version.outputs.VERSION }} georchestra/datafeeder:latest
docker tag georchestra/datafeeder-frontend:${{ steps.version.outputs.VERSION }} georchestra/datafeeder-frontend:latest
docker push georchestra/datafeeder:latest
docker push georchestra/datafeeder-frontend:latest
- name: "Pushing release branch to docker.io (22.x series)"
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra'
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/datafeeder:${{ steps.version.outputs.VERSION }}
docker push georchestra/datafeeder-frontend:${{ steps.version.outputs.VERSION }}
- name: "Pushing release tag to docker.io (22.x series)"
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra'
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/datafeeder:${{ steps.version.outputs.VERSION }}
docker push georchestra/datafeeder-frontend:${{ steps.version.outputs.VERSION }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/extractorapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,35 +38,35 @@ jobs:
run: ../mvnw --no-transfer-progress clean verify -Pit -Dfmt.skip=true -Dadditionalparam=-Xdoclint:none

- name: Getting image tag
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
id: version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)

- name: "Building docker image"
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
working-directory: extractorapp/
run: ../mvnw --no-transfer-progress clean package docker:build -Pdocker,log4j-logstash,sentry-log4j -DdockerImageName=georchestra/extractorapp:${{ steps.version.outputs.VERSION }} -DskipTests

- name: "Logging in docker.io"
uses: azure/docker-login@v1
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'

- name: "Pushing latest to docker.io"
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra'
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker tag georchestra/extractorapp:${{ steps.version.outputs.VERSION }} georchestra/extractorapp:latest
docker push georchestra/extractorapp:latest
- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra'
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/extractorapp:${{ steps.version.outputs.VERSION }}
- name: "Pushing release tag to docker.io"
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra'
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/extractorapp:${{ steps.version.outputs.VERSION }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/geonetwork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,34 +59,34 @@ jobs:
run: ../../mvnw verify -ntp -Dadditionalparam=-Xdoclint:none

- name: Getting image tag
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
id: version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)

- name: "Build GeoNetwork docker image"
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
cd geonetwork/web
../../mvnw package docker:build -Pdocker -DdockerImageName=georchestra/geonetwork -DdockerImageTags=${{ steps.version.outputs.VERSION }},latest -DskipTests -ntp
- name: "Logging in docker.io"
uses: azure/docker-login@v1
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'

- name: "Pushing latest to docker.io"
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra'
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/geonetwork:latest
- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra'
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/geonetwork:${{ steps.version.outputs.VERSION }}
- name: "Pushing release tag to docker.io"
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra'
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/geonetwork:${{ steps.version.outputs.VERSION }}
14 changes: 7 additions & 7 deletions .github/workflows/geoserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,44 +41,44 @@ jobs:
run: ../mvnw --no-transfer-progress clean verify -Pit -Dfmt.skip=true -Dadditionalparam=-Xdoclint:none

- name: Getting image tag
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
id: version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)

- name: "Building docker image with native security"
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
working-directory: geoserver/webapp
run: ../../mvnw --no-transfer-progress clean package docker:build -Pdocker,log4j-logstash,sentry-log4j,${{ env.GEOSERVER_EXTENSION_PROFILES }} -DdockerImageName=georchestra/geoserver:${{ steps.version.outputs.VERSION }} -DskipTests


- name: "Building docker image with geofence"
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
working-directory: geoserver/webapp
run: ../../mvnw --no-transfer-progress clean package docker:build -Pdocker,${{ env.GEOSERVER_EXTENSION_PROFILES }},geofence,log4j-logstash,sentry-log4j -DdockerImageName=georchestra/geoserver:${{ steps.version.outputs.VERSION }}-geofence -DskipTests

- name: "Logging in docker.io"
uses: azure/docker-login@v1
if: github.repository == 'georchestra/georchestra'
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'

- name: "Pushing latest to docker.io"
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra'
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker tag georchestra/geoserver:${{ steps.version.outputs.VERSION }} georchestra/geoserver:latest
docker tag georchestra/geoserver:${{ steps.version.outputs.VERSION }}-geofence georchestra/geoserver:geofence
docker push georchestra/geoserver:latest
docker push georchestra/geoserver:geofence
- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra'
if: contains(github.ref, 'refs/heads/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/geoserver:${{ steps.version.outputs.VERSION }}
docker push georchestra/geoserver:${{ steps.version.outputs.VERSION }}-geofence
- name: "Pushing release tag to docker.io"
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra'
if: contains(github.ref, 'refs/tags/22.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/geoserver:${{ steps.version.outputs.VERSION }}
docker push georchestra/geoserver:${{ steps.version.outputs.VERSION }}-geofence
Expand Down

0 comments on commit 62a8111

Please sign in to comment.