Remove Test Workflows

Signed-off-by: divyansh42 <diagrawa@redhat.com>
This commit is contained in:
divyansh42 2021-01-19 20:47:25 +05:30
parent 82f1760c2f
commit 145fa2584c
8 changed files with 12 additions and 190 deletions

View file

@ -1,48 +0,0 @@
# This workflow will perform a test whenever there
# is some change in code done to ensure that the changes
# are not buggy and we are getting the desired output.
name: Test Push with Podman newer
on: [ push, workflow_dispatch ]
env:
IMAGE_NAME: myimage
IMAGE_REGISTRY: quay.io
IMAGE_TAG: latest
jobs:
build:
name: Push image to Quay.io
runs-on: ubuntu-20.04
steps:
# Checkout push-to-registry action github repository
- name: Checkout Push to Registry action
uses: actions/checkout@v2
- name: Build Image using Docker
run: |
docker build -t ${{ env.IMAGE_NAME }}:latest -<<EOF
FROM busybox
RUN echo "hello world"
EOF
- name: Build Image using Podman
run: |
podman build -t ${{ env.IMAGE_NAME }}:latest -<<EOF
FROM busybox
RUN echo "hello world"
EOF
# Push the image to image registry
- name: Push To Quay
uses: ./
id: push
with:
image: ${{ env.IMAGE_NAME }}
tag: ${{ env.IMAGE_TAG }}
registry: ${{ env.IMAGE_REGISTRY }}/${{ secrets.REGISTRY_USER }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Echo outputs
run: |
echo "registry-path ${{ steps.push.outputs.registry-path }}"
echo "digest ${{ steps.push.outputs.digest }}"

View file

@ -1,48 +0,0 @@
# This workflow will perform a test whenever there
# is some change in code done to ensure that the changes
# are not buggy and we are getting the desired output.
name: Test Push with docker newer
on: [ push, workflow_dispatch ]
env:
IMAGE_NAME: myimage
IMAGE_REGISTRY: quay.io
IMAGE_TAG: latest
jobs:
build:
name: Push image to Quay.io
runs-on: ubuntu-20.04
steps:
# Checkout push-to-registry action github repository
- name: Checkout Push to Registry action
uses: actions/checkout@v2
- name: Build Image using Podman
run: |
podman build -t ${{ env.IMAGE_NAME }}:latest -<<EOF
FROM busybox
RUN echo "hello world"
EOF
- name: Build Image using Docker
run: |
docker build -t ${{ env.IMAGE_NAME }}:latest -<<EOF
FROM busybox
RUN echo "hello world"
EOF
# Push the image to image registry
- name: Push To Quay
uses: ./
id: push
with:
image: ${{ env.IMAGE_NAME }}
tag: ${{ env.IMAGE_TAG }}
registry: ${{ env.IMAGE_REGISTRY }}/${{ secrets.REGISTRY_USER }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Echo outputs
run: |
echo "registry-path ${{ steps.push.outputs.registry-path }}"
echo "digest ${{ steps.push.outputs.digest }}"

View file

@ -1,41 +0,0 @@
# This workflow will perform a test whenever there
# is some change in code done to ensure that the changes
# are not buggy and we are getting the desired output.
name: Test Push with only Podman
on: [ push, workflow_dispatch ]
env:
IMAGE_NAME: myimage
IMAGE_REGISTRY: quay.io
IMAGE_TAG: latest
jobs:
build:
name: Push image to Quay.io
runs-on: ubuntu-20.04
steps:
# Checkout push-to-registry action github repository
- name: Checkout Push to Registry action
uses: actions/checkout@v2
- name: Build Image using Podman
run: |
podman build -t ${{ env.IMAGE_NAME }}:latest -<<EOF
FROM busybox
RUN echo "hello world"
EOF
# Push the image to image registry
- name: Push To Quay
uses: ./
id: push
with:
image: ${{ env.IMAGE_NAME }}
tag: ${{ env.IMAGE_TAG }}
registry: ${{ env.IMAGE_REGISTRY }}/${{ secrets.REGISTRY_USER }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Echo outputs
run: |
echo "registry-path ${{ steps.push.outputs.registry-path }}"
echo "digest ${{ steps.push.outputs.digest }}"

View file

@ -1,41 +0,0 @@
# This workflow will perform a test whenever there
# is some change in code done to ensure that the changes
# are not buggy and we are getting the desired output.
name: Test Push with only Docker
on: [ push, workflow_dispatch ]
env:
IMAGE_NAME: myimage
IMAGE_REGISTRY: quay.io
IMAGE_TAG: latest
jobs:
build:
name: Push image to Quay.io
runs-on: ubuntu-20.04
steps:
# Checkout push-to-registry action github repository
- name: Checkout Push to Registry action
uses: actions/checkout@v2
- name: Build Image using Docker
run: |
docker build -t ${{ env.IMAGE_NAME }}:latest -<<EOF
FROM busybox
RUN echo "hello world"
EOF
# Push the image to image registry
- name: Push To Quay
uses: ./
id: push
with:
image: ${{ env.IMAGE_NAME }}
tag: ${{ env.IMAGE_TAG }}
registry: ${{ env.IMAGE_REGISTRY }}/${{ secrets.REGISTRY_USER }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Echo outputs
run: |
echo "registry-path ${{ steps.push.outputs.registry-path }}"
echo "digest ${{ steps.push.outputs.digest }}"

View file

@ -17,12 +17,12 @@ jobs:
- name: Checkout Push to Registry action - name: Checkout Push to Registry action
uses: actions/checkout@v2 uses: actions/checkout@v2
# - name: Build Image using Docker - name: Build Image using Docker
# run: | run: |
# docker build -t ${{ env.IMAGE_NAME }}:latest -<<EOF docker build -t ${{ env.IMAGE_NAME }}:latest -<<EOF
# FROM busybox FROM busybox
# RUN echo "hello world" RUN echo "hello world"
# EOF EOF
# Push the image to image registry # Push the image to image registry
- name: Push To Quay - name: Push To Quay

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -46,7 +46,7 @@ async function run(): Promise<void> {
// failing if image is not found in Docker as well as Podman // failing if image is not found in Docker as well as Podman
if (!isPresentInDocker && !isPresentInPodman) { if (!isPresentInDocker && !isPresentInPodman) {
throw new Error(`Image ${imageToPush} not found in Podman local storage, or Docker local storage.`); throw new Error(`${imageToPush} not found in Podman local storage, or Docker local storage.`);
} }
if (isPresentInPodman && isPresentInDocker) { if (isPresentInPodman && isPresentInDocker) {
@ -66,7 +66,7 @@ async function run(): Promise<void> {
} }
else if (isPresentInDocker) { else if (isPresentInDocker) {
imageToPush = `${dockerBaseUrl}/${imageToPush}`; imageToPush = `${dockerBaseUrl}/${imageToPush}`;
core.info(`Image ${imageToPush} was found in the Docker image storage, but not in the Podman ` core.info(`${imageToPush} was found in the Docker image storage, but not in the Podman `
+ `image storage. The image will be pulled into Podman image storage, pushed, and then ` + `image storage. The image will be pulled into Podman image storage, pushed, and then `
+ `removed from the Podman image storage.`); + `removed from the Podman image storage.`);
isImageFromDocker = true; isImageFromDocker = true;
@ -140,11 +140,11 @@ async function checkImageInPodman(): Promise<boolean> {
core.info(`Checking if ${imageToPush} is in Podman image storage`); core.info(`Checking if ${imageToPush} is in Podman image storage`);
try { try {
await execute(await getPodmanPath(), [ "image", "exists", imageToPush ]); await execute(await getPodmanPath(), [ "image", "exists", imageToPush ]);
core.info(`Image ${imageToPush} found in Podman image storage`); core.info(`${imageToPush} found in Podman image storage`);
return true; return true;
} }
catch (err) { catch (err) {
core.info(`Image ${imageToPush} not found in Podman image storage`); core.info(`${imageToPush} not found in Podman image storage`);
core.debug(err); core.debug(err);
return false; return false;
} }