From 8c0d5c22b21c5c866a0a97dc05d422188926c6d4 Mon Sep 17 00:00:00 2001 From: Torsten Egenolf Date: Fri, 6 Oct 2023 13:20:36 +0200 Subject: [PATCH 1/6] feat(ci): test pushing docker packages --- .github/workflows/ci-deploy.yml | 37 ---------------- .github/workflows/ci-main.yml | 4 +- .github/workflows/ci-sonar.yml | 78 ++++++++++++++++----------------- 3 files changed, 42 insertions(+), 77 deletions(-) delete mode 100644 .github/workflows/ci-deploy.yml diff --git a/.github/workflows/ci-deploy.yml b/.github/workflows/ci-deploy.yml deleted file mode 100644 index 3e481bd..0000000 --- a/.github/workflows/ci-deploy.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: ci-deploy -on: - workflow_dispatch: - inputs: - version: - required: true - description: Version to deploy -jobs: - deploy: - runs-on: ubuntu-22.04 - environment: dev - env: - APP_VERSION: ${{ github.event.inputs.version }} - steps: - - name: cf setup - run: |- - curl -sL "https://packages.cloudfoundry.org/stable?release=${CF_RELEASE}&version=${CF_VERSION}" | \ - sudo tar -zx -C /usr/local/bin - env: - CF_VERSION: 7.2.0 - CF_RELEASE: linux64-binary - - name: cf push - run: |- - cf api ${CF_API} - cf auth - cf target -o ${CF_ORG} -s ${CF_SPACE} - cf push ${APP_NAME} --docker-image ${APP_IMAGE}:${APP_VERSION} --docker-username ${CF_DOCKER_USERNAME} - env: - APP_NAME: dgca-verifier-service-eu-test - APP_IMAGE: docker.pkg.github.com/${{ github.repository }}/tng-key-distribution - CF_API: ${{ secrets.CF_API }} - CF_ORG: ${{ secrets.CF_ORG }} - CF_SPACE: ${{ secrets.CF_SPACE }} - CF_USERNAME: ${{ secrets.CF_USERNAME }} - CF_PASSWORD: ${{ secrets.CF_PASSWORD }} - CF_DOCKER_USERNAME: ${{ secrets.CF_DOCKER_USERNAME }} - CF_DOCKER_PASSWORD: ${{ secrets.CF_DOCKER_PASSWORD }} diff --git a/.github/workflows/ci-main.yml b/.github/workflows/ci-main.yml index f1751ac..1689a5f 100644 --- a/.github/workflows/ci-main.yml +++ b/.github/workflows/ci-main.yml @@ -3,6 +3,7 @@ on: push: branches: - main + - feature/ci-workflow-for-who jobs: build: runs-on: ubuntu-22.04 @@ -47,6 +48,7 @@ jobs: APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }} - name: docker run: |- + echo "docker image name: ${APP_PACKAGES_URL}:${APP_VERSION}" echo "${APP_PACKAGES_PASSWORD}" | docker login "${APP_PACKAGES_URL}" \ --username "${APP_PACKAGES_USERNAME}" \ --password-stdin @@ -55,6 +57,6 @@ jobs: --tag "${APP_PACKAGES_URL}:${APP_VERSION}" docker push "${APP_PACKAGES_URL}:${APP_VERSION}" env: - APP_PACKAGES_URL: docker.pkg.github.com/${{ github.repository }}/dgca-verifier-service + APP_PACKAGES_URL: docker.pkg.github.com/${{ github.repository }}/tng-key-distribution APP_PACKAGES_USERNAME: ${{ github.actor }} APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci-sonar.yml b/.github/workflows/ci-sonar.yml index be6e0bc..3959599 100644 --- a/.github/workflows/ci-sonar.yml +++ b/.github/workflows/ci-sonar.yml @@ -1,39 +1,39 @@ -name: ci-sonar -on: - push: - branches: - - main - pull_request: - types: - - opened - - synchronize - - reopened -jobs: - sonar: - runs-on: ubuntu-22.04 - steps: - - uses: actions/setup-java@v2 - with: - java-version: 17 - distribution: adopt - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - uses: actions/cache@v2 - with: - path: | - ~/.m2/repository - key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }} - - name: mvn - run: |- - mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ - --batch-mode \ - --file ./pom.xml \ - --settings ./settings.xml \ - --define app.packages.username="${APP_PACKAGES_USERNAME}" \ - --define app.packages.password="${APP_PACKAGES_PASSWORD}" - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - APP_PACKAGES_USERNAME: ${{ github.actor }} - APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }} +#name: ci-sonar +#on: +# push: +# branches: +# - main +# pull_request: +# types: +# - opened +# - synchronize +# - reopened +#jobs: +# sonar: +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/setup-java@v2 +# with: +# java-version: 17 +# distribution: adopt +# - uses: actions/checkout@v2 +# with: +# fetch-depth: 0 +# - uses: actions/cache@v2 +# with: +# path: | +# ~/.m2/repository +# key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }} +# - name: mvn +# run: |- +# mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ +# --batch-mode \ +# --file ./pom.xml \ +# --settings ./settings.xml \ +# --define app.packages.username="${APP_PACKAGES_USERNAME}" \ +# --define app.packages.password="${APP_PACKAGES_PASSWORD}" +# env: +# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# APP_PACKAGES_USERNAME: ${{ github.actor }} +# APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }} From 0cef9502619b35b88b37dde2ec0d5ef3ff76a7de Mon Sep 17 00:00:00 2001 From: Torsten Egenolf Date: Fri, 6 Oct 2023 13:32:05 +0200 Subject: [PATCH 2/6] feat(ci): test pushing docker packages lowercase --- .github/workflows/ci-main.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci-main.yml b/.github/workflows/ci-main.yml index 1689a5f..483ca7b 100644 --- a/.github/workflows/ci-main.yml +++ b/.github/workflows/ci-main.yml @@ -47,16 +47,16 @@ jobs: APP_PACKAGES_USERNAME: ${{ github.actor }} APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }} - name: docker - run: |- - echo "docker image name: ${APP_PACKAGES_URL}:${APP_VERSION}" - echo "${APP_PACKAGES_PASSWORD}" | docker login "${APP_PACKAGES_URL}" \ - --username "${APP_PACKAGES_USERNAME}" \ - --password-stdin - docker build . \ - --file ./Dockerfile \ - --tag "${APP_PACKAGES_URL}:${APP_VERSION}" - docker push "${APP_PACKAGES_URL}:${APP_VERSION}" + run: >- + echo "${APP_PACKAGES_PASSWORD}" | + docker login "${APP_PACKAGES_URL}" + --username "${APP_PACKAGES_USERNAME}" + --password-stdin; + docker build . + --file ./Dockerfile + --tag "${APP_PACKAGES_URL}:${APP_VERSION}"; + docker push "${APP_PACKAGES_URL}:${APP_VERSION}"; env: - APP_PACKAGES_URL: docker.pkg.github.com/${{ github.repository }}/tng-key-distribution + APP_PACKAGES_URL: ghcr.io/worldhealthorganization/tng-key-distribution/tng-key-distribution APP_PACKAGES_USERNAME: ${{ github.actor }} APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }} From 6f588496e703567f2817d4021b2511c553667618 Mon Sep 17 00:00:00 2001 From: Torsten Egenolf Date: Fri, 6 Oct 2023 13:37:17 +0200 Subject: [PATCH 3/6] feat(ci): removed branch from workflow --- .github/workflows/ci-main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci-main.yml b/.github/workflows/ci-main.yml index 483ca7b..a431898 100644 --- a/.github/workflows/ci-main.yml +++ b/.github/workflows/ci-main.yml @@ -3,7 +3,6 @@ on: push: branches: - main - - feature/ci-workflow-for-who jobs: build: runs-on: ubuntu-22.04 From 67ffbdfdcf0724da0a9fcdaf62d983df9e5d45e1 Mon Sep 17 00:00:00 2001 From: Torsten Egenolf Date: Fri, 6 Oct 2023 13:38:38 +0200 Subject: [PATCH 4/6] feat(ci): removed branch from workflow --- .github/workflows/ci-main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-main.yml b/.github/workflows/ci-main.yml index a431898..adc5fb8 100644 --- a/.github/workflows/ci-main.yml +++ b/.github/workflows/ci-main.yml @@ -3,6 +3,8 @@ on: push: branches: - main + + jobs: build: runs-on: ubuntu-22.04 From f4d5b9430ca4b821d9bdb7cf928b7c8b4b169403 Mon Sep 17 00:00:00 2001 From: Torsten Egenolf Date: Fri, 6 Oct 2023 13:39:37 +0200 Subject: [PATCH 5/6] feat(ci): trigger workflow --- .github/workflows/ci-main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-main.yml b/.github/workflows/ci-main.yml index adc5fb8..a1e2bb9 100644 --- a/.github/workflows/ci-main.yml +++ b/.github/workflows/ci-main.yml @@ -3,7 +3,7 @@ on: push: branches: - main - + - feature/ci-workflow-for-who jobs: build: From bd223c6165271fd5543676936282331c5a83b55a Mon Sep 17 00:00:00 2001 From: Torsten Egenolf Date: Fri, 6 Oct 2023 13:40:23 +0200 Subject: [PATCH 6/6] feat(ci): trigger workflow --- .github/workflows/ci-main.yml | 1 - .github/workflows/ci-sonar.yml | 39 ---------------------------------- 2 files changed, 40 deletions(-) delete mode 100644 .github/workflows/ci-sonar.yml diff --git a/.github/workflows/ci-main.yml b/.github/workflows/ci-main.yml index a1e2bb9..53cda92 100644 --- a/.github/workflows/ci-main.yml +++ b/.github/workflows/ci-main.yml @@ -3,7 +3,6 @@ on: push: branches: - main - - feature/ci-workflow-for-who jobs: build: diff --git a/.github/workflows/ci-sonar.yml b/.github/workflows/ci-sonar.yml deleted file mode 100644 index 3959599..0000000 --- a/.github/workflows/ci-sonar.yml +++ /dev/null @@ -1,39 +0,0 @@ -#name: ci-sonar -#on: -# push: -# branches: -# - main -# pull_request: -# types: -# - opened -# - synchronize -# - reopened -#jobs: -# sonar: -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/setup-java@v2 -# with: -# java-version: 17 -# distribution: adopt -# - uses: actions/checkout@v2 -# with: -# fetch-depth: 0 -# - uses: actions/cache@v2 -# with: -# path: | -# ~/.m2/repository -# key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }} -# - name: mvn -# run: |- -# mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ -# --batch-mode \ -# --file ./pom.xml \ -# --settings ./settings.xml \ -# --define app.packages.username="${APP_PACKAGES_USERNAME}" \ -# --define app.packages.password="${APP_PACKAGES_PASSWORD}" -# env: -# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# APP_PACKAGES_USERNAME: ${{ github.actor }} -# APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}