Skip to content

Implement custom scripts (#4083) #1

Implement custom scripts (#4083)

Implement custom scripts (#4083) #1

Workflow file for this run

name: "security-proxy"
on:
workflow_dispatch:
push:
paths:
- "commons/**"
- "ldap-account-management/**"
- "security-proxy/**"
pull_request:
paths:
- "commons/**"
- "ldap-account-management/**"
- "security-proxy/**"
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: "Checking out"
uses: actions/checkout@v1
- name: "Setting up Java"
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: 'maven'
server-id: geOrchestra-artifactory
server-username: ARTIFACTORY_USERNAME_REF
server-password: ARTIFACTORY_TOKEN_REF
- name: "Installing & checking formatting"
run: ./mvnw install -pl :security-proxy --also-make -P-all,security-proxy -DskipTests --no-transfer-progress -B -Dfmt.action=validate -Dadditionalparam=-Xdoclint:none
# note "-pl :security-proxy --also-make" builds only the project and its dependencies
- name: "Running tests"
working-directory: security-proxy/
run: ../mvnw verify -Pit --no-transfer-progress -Dfmt.skip=true -Dadditionalparam=-Xdoclint:none
- name: Getting image tag
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' && github.actor != 'dependabot[bot]'
working-directory: security-proxy/
run: ../mvnw clean package docker:build -Pdocker,log4j-logstash,sentry-log4j -DdockerImageName=georchestra/security-proxy:${{ steps.version.outputs.VERSION }} -DskipTests --no-transfer-progress
- name: "Logging in docker.io"
uses: azure/docker-login@v1
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' && github.actor != 'dependabot[bot]'
run: |
docker tag georchestra/security-proxy:${{ steps.version.outputs.VERSION }} georchestra/security-proxy:latest
docker push georchestra/security-proxy:latest
- name: "Pushing release branch to docker.io"
if: contains(github.ref, 'refs/heads/23.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/security-proxy:${{ steps.version.outputs.VERSION }}
- name: "Pushing release tag to docker.io"
if: contains(github.ref, 'refs/tags/23.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]'
run: |
docker push georchestra/security-proxy:${{ steps.version.outputs.VERSION }}
- name: "Publish war in artifactory"
run: ./mvnw deploy -pl :security-proxy -P-all,security-proxy -DskipTests
continue-on-error: true
env:
ARTIFACTORY_TOKEN_REF: ${{ secrets.ARTIFACTORY_TOKEN }}
ARTIFACTORY_USERNAME_REF: ${{ secrets.ARTIFACTORY_USERNAME }}
- name: "Remove SNAPSHOT jars from repository"
run: |
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}