Skip to content

Commit

Permalink
pat check for kube (#282)
Browse files Browse the repository at this point in the history
* pat check for kube

Signed-off-by: Ryan Cook <rcook@redhat.com>

* podman vers bump

Signed-off-by: Ryan Cook <rcook@redhat.com>

Signed-off-by: Ryan Cook <rcook@redhat.com>
  • Loading branch information
cooktheryan committed Dec 21, 2022
1 parent f85359c commit c0dcbe3
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 2 deletions.
64 changes: 62 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
CGO_ENABLED: 0
PODMAN_VER: v4.1.1
PODMAN_VER: v4.2.1

jobs:

Expand All @@ -30,7 +30,7 @@ jobs:
if: steps.cache-podman-bin.outputs.cache-hit != 'true'
with:
repository: containers/podman
ref: v4.1.1
ref: v4.2.1

- uses: actions/setup-go@v2
if: steps.cache-podman-bin.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -375,6 +375,66 @@ jobs:
- name: Print the current running container
run: sudo podman ps

fetchit-PAT-kube-validate:
runs-on: ubuntu-latest
needs: [ build , pull-and-archive ]
steps:
- uses: actions/checkout@v2

- name: pull in podman
uses: actions/download-artifact@v1
with:
name: podman-bins
path: bin

- name: replace
run: |
chmod +x bin/podman
sudo mv bin/podman /usr/bin/podman
- name: Enable the podman socket
run: sudo systemctl enable --now podman.socket

- name: pull artifact
uses: actions/download-artifact@v1
with:
name: fetchit-image
path: /tmp

- name: Load the image
run: sudo podman load -i /tmp/fetchit.tar

- name: pull artifact
uses: actions/download-artifact@v1
with:
name: colors
path: /tmp

- name: Load the image
run: sudo podman load -i /tmp/colors.tar

- name: tag the image
run: sudo podman tag quay.io/fetchit/fetchit-amd:latest quay.io/fetchit/fetchit:latest

- name: swap in the GITHUB PAT token
run: sudo sed -i "s/CHANGEME/${{ secrets.GITHUB_TOKEN }}/g" ./examples/pat-testing-kube.yaml

- name: Start fetchit
run: sudo podman run -d --name fetchit -v fetchit-volume:/opt -v ./examples/pat-testing-kube.yaml:/opt/mount/config.yaml -v /run/podman/podman.sock:/run/podman/podman.sock --security-opt label=disable quay.io/fetchit/fetchit-amd:latest

- name: Wait for fetchit to deploy
run: sleep 1m

- name: Logs
if: always()
run: sudo podman logs fetchit

- name: verify container is running
run: if [[ $(sudo podman pod ps | grep -v CON= | grep colors_pod | wc -l) = "1" ]] ; then echo "Container successfully launched"; else exit 1; fi

- name: Print the current running container
run: sudo podman ps

raw-validate:
runs-on: ubuntu-latest
needs: [ build , pull-and-archive ]
Expand Down
12 changes: 12 additions & 0 deletions examples/pat-testing-kube.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# for this test, start with this config, then wait to be sure the
# targetConfigs from .fetchit/config.yaml are populated
# and for follow-up test, push a change to the config and confirm
# new targetConfigs are fetched & run
targetConfigs:
- url: https://github.com/containers/fetchit
pat: CHANGEME
kube:
- name: kube-ex
targetPath: examples/kube
schedule: "*/1 * * * *"
branch: main

0 comments on commit c0dcbe3

Please sign in to comment.