mirror of
https://github.com/redhat-actions/push-to-registry.git
synced 2025-02-22 18:21:20 +01:00
Simplify push test (#48)
- shorter, faster, simpler - now all test workflows are pushing 'ptr-test' - no more petclinic Signed-off-by: Tim Etchells <tetchel@gmail.com>
This commit is contained in:
parent
dff05ea2fa
commit
ef7cace71d
3 changed files with 9 additions and 59 deletions
2
.github/workflows/multiple-build.yaml
vendored
2
.github/workflows/multiple-build.yaml
vendored
|
@ -8,7 +8,7 @@ on:
|
||||||
env:
|
env:
|
||||||
IMAGE_REGISTRY: quay.io
|
IMAGE_REGISTRY: quay.io
|
||||||
IMAGE_NAMESPACE: redhat-github-actions
|
IMAGE_NAMESPACE: redhat-github-actions
|
||||||
IMAGE_NAME: myimage
|
IMAGE_NAME: ptr-test
|
||||||
IMAGE_TAG: v1
|
IMAGE_TAG: v1
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
2
.github/workflows/verify-login-push.yml
vendored
2
.github/workflows/verify-login-push.yml
vendored
|
@ -11,7 +11,7 @@ on:
|
||||||
env:
|
env:
|
||||||
IMAGE_REGISTRY: quay.io
|
IMAGE_REGISTRY: quay.io
|
||||||
IMAGE_NAMESPACE: redhat-github-actions
|
IMAGE_NAMESPACE: redhat-github-actions
|
||||||
IMAGE_NAME: myimage
|
IMAGE_NAME: ptr-test
|
||||||
IMAGE_TAGS: v1 ${{ github.sha }}
|
IMAGE_TAGS: v1 ${{ github.sha }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
64
.github/workflows/verify-push.yaml
vendored
64
.github/workflows/verify-push.yaml
vendored
|
@ -9,10 +9,9 @@ on:
|
||||||
- cron: '0 0 * * *' # every day at midnight
|
- cron: '0 0 * * *' # every day at midnight
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PROJECT_DIR: spring-petclinic
|
|
||||||
IMAGE_REGISTRY: quay.io
|
IMAGE_REGISTRY: quay.io
|
||||||
IMAGE_NAMESPACE: redhat-github-actions
|
IMAGE_NAMESPACE: redhat-github-actions
|
||||||
IMAGE_NAME: spring-petclinic
|
IMAGE_NAME: ptr-test
|
||||||
IMAGE_TAGS: v1 ${{ github.sha }}
|
IMAGE_TAGS: v1 ${{ github.sha }}
|
||||||
MVN_REPO_DIR: ~/.m2/repository
|
MVN_REPO_DIR: ~/.m2/repository
|
||||||
|
|
||||||
|
@ -26,60 +25,15 @@ jobs:
|
||||||
install_latest: [ true, false ]
|
install_latest: [ true, false ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
# Checkout push-to-registry action github repository
|
# Checkout push-to-registry action github repository
|
||||||
- name: Checkout Push to Registry action
|
- name: Checkout Push to Registry action
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
|
||||||
path: "push-to-registry"
|
|
||||||
|
|
||||||
- name: Install latest podman
|
- name: Install latest podman
|
||||||
if: matrix.install_latest
|
if: matrix.install_latest
|
||||||
run: |
|
run: |
|
||||||
bash push-to-registry/.github/install_latest_podman.sh
|
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
|
# Build image using Buildah action
|
||||||
- name: Build Image
|
- name: Build Image
|
||||||
id: build_image
|
id: build_image
|
||||||
|
@ -87,20 +41,16 @@ jobs:
|
||||||
with:
|
with:
|
||||||
image: ${{ env.IMAGE_NAME }}
|
image: ${{ env.IMAGE_NAME }}
|
||||||
tags: ${{ env.IMAGE_TAGS }}
|
tags: ${{ env.IMAGE_TAGS }}
|
||||||
base-image: 'registry.access.redhat.com/openjdk/openjdk-11-rhel7'
|
base-image: busybox:latest
|
||||||
# To avoid hardcoding a particular version of the binary.
|
|
||||||
content: |
|
|
||||||
./spring-petclinic/target/spring-petclinic-*.jar
|
|
||||||
entrypoint: |
|
entrypoint: |
|
||||||
java
|
bash
|
||||||
-jar
|
-c
|
||||||
spring-petclinic-*.jar
|
echo 'hello world'
|
||||||
port: 8080
|
oci: true
|
||||||
oci: 'true'
|
|
||||||
|
|
||||||
# Push the image to Quay.io (Image Registry)
|
# Push the image to Quay.io (Image Registry)
|
||||||
- name: Push To Quay
|
- name: Push To Quay
|
||||||
uses: ./push-to-registry/
|
uses: ./
|
||||||
id: push
|
id: push
|
||||||
with:
|
with:
|
||||||
image: ${{ steps.build_image.outputs.image }}
|
image: ${{ steps.build_image.outputs.image }}
|
||||||
|
|
Loading…
Add table
Reference in a new issue