From ef7cace71d4164285c6c3feb7417f9a52935c6e8 Mon Sep 17 00:00:00 2001 From: Tim Etchells Date: Mon, 13 Sep 2021 14:14:59 -0700 Subject: [PATCH] Simplify push test (#48) - shorter, faster, simpler - now all test workflows are pushing 'ptr-test' - no more petclinic Signed-off-by: Tim Etchells --- .github/workflows/multiple-build.yaml | 2 +- .github/workflows/verify-login-push.yml | 2 +- .github/workflows/verify-push.yaml | 64 +++---------------------- 3 files changed, 9 insertions(+), 59 deletions(-) diff --git a/.github/workflows/multiple-build.yaml b/.github/workflows/multiple-build.yaml index 0b95c2b..2b65d0e 100644 --- a/.github/workflows/multiple-build.yaml +++ b/.github/workflows/multiple-build.yaml @@ -8,7 +8,7 @@ on: env: IMAGE_REGISTRY: quay.io IMAGE_NAMESPACE: redhat-github-actions - IMAGE_NAME: myimage + IMAGE_NAME: ptr-test IMAGE_TAG: v1 jobs: diff --git a/.github/workflows/verify-login-push.yml b/.github/workflows/verify-login-push.yml index a659f92..39e3a4a 100644 --- a/.github/workflows/verify-login-push.yml +++ b/.github/workflows/verify-login-push.yml @@ -11,7 +11,7 @@ on: env: IMAGE_REGISTRY: quay.io IMAGE_NAMESPACE: redhat-github-actions - IMAGE_NAME: myimage + IMAGE_NAME: ptr-test IMAGE_TAGS: v1 ${{ github.sha }} jobs: diff --git a/.github/workflows/verify-push.yaml b/.github/workflows/verify-push.yaml index 50845df..60aed25 100644 --- a/.github/workflows/verify-push.yaml +++ b/.github/workflows/verify-push.yaml @@ -9,10 +9,9 @@ on: - cron: '0 0 * * *' # every day at midnight env: - PROJECT_DIR: spring-petclinic IMAGE_REGISTRY: quay.io IMAGE_NAMESPACE: redhat-github-actions - IMAGE_NAME: spring-petclinic + IMAGE_NAME: ptr-test IMAGE_TAGS: v1 ${{ github.sha }} MVN_REPO_DIR: ~/.m2/repository @@ -26,60 +25,15 @@ jobs: install_latest: [ true, false ] steps: - # Checkout push-to-registry action github repository - name: Checkout Push to Registry action uses: actions/checkout@v2 - with: - path: "push-to-registry" - name: Install latest podman if: matrix.install_latest run: | bash push-to-registry/.github/install_latest_podman.sh - # Checkout spring-petclinic github repository - - name: Checkout spring-petclinic project - uses: actions/checkout@v2 - with: - repository: "spring-projects/spring-petclinic" - path: ${{ env.PROJECT_DIR }} - - # If none of these files has changed, we assume that the contents of - # .m2/repository can be fetched from the cache. - - name: Hash Maven files - working-directory: ${{ env.PROJECT_DIR }} - run: | - echo "MVN_HASH=${{ hashFiles('**/pom.xml', '.mvn/**/*', 'mvnw*') }}" >> $GITHUB_ENV - - # Download the m2 repository from the cache to speed up the build. - - name: Check for Maven cache - id: check-mvn-cache - uses: actions/cache@v2 - with: - path: ${{ env.MVN_REPO_DIR }} - key: ${{ env.MVN_HASH }} - - # Setup java. - - name: Setup Java - uses: actions/setup-java@v1 - with: - java-version: 11 - - # Run maven to build the project - - name: Maven - working-directory: ${{ env.PROJECT_DIR }} - run: | - mvn package -ntp -B - - # If there was no cache hit above, store the output into the cache now. - - name: Save Maven repo into cache - if: ${{ steps.check-mvn-cache.outputs.cache-hit }} != 'true' - uses: actions/cache@v2 - with: - path: ${{ env.MVN_REPO_DIR }} - key: ${{ env.MVN_HASH }} - # Build image using Buildah action - name: Build Image id: build_image @@ -87,20 +41,16 @@ jobs: with: image: ${{ env.IMAGE_NAME }} tags: ${{ env.IMAGE_TAGS }} - base-image: 'registry.access.redhat.com/openjdk/openjdk-11-rhel7' - # To avoid hardcoding a particular version of the binary. - content: | - ./spring-petclinic/target/spring-petclinic-*.jar + base-image: busybox:latest entrypoint: | - java - -jar - spring-petclinic-*.jar - port: 8080 - oci: 'true' + bash + -c + echo 'hello world' + oci: true # Push the image to Quay.io (Image Registry) - name: Push To Quay - uses: ./push-to-registry/ + uses: ./ id: push with: image: ${{ steps.build_image.outputs.image }}