Added image metadata for krknctl
(#213)
#250
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
on: | |
workflow_dispatch: | |
inputs: | |
test_list: | |
description: Only run tests that match the regular expression | |
default: "" | |
required: false | |
push: | |
branches: ['main'] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Login in quay | |
run: docker login quay.io -u ${QUAY_USER} -p ${QUAY_TOKEN} | |
env: | |
QUAY_USER: ${{ secrets.QUAY_USERNAME }} | |
QUAY_TOKEN: ${{ secrets.QUAY_PASSWORD }} | |
- name: Check out code | |
uses: actions/checkout@main | |
- name: Add krknctl metadata to Dockerfiles | |
run: | | |
SCENARIOS=( application-outages container-scenarios network-chaos node-cpu-hog node-io-hog \ | |
node-memory-hog node-scenarios pod-network-chaos pod-scenarios power-outages pvc-scenario \ | |
service-disruption-scenarios service-hijacking syn-flood time-scenarios zone-outages ) | |
for i in "${SCENARIOS[@]}"; do | |
export KRKNCTL_INPUT=$(cat $i/krknctl-input.json|tr -d '\n') | |
envsubst < $i/Dockerfile.template > $i/Dockerfile | |
done; | |
- name: Build the Docker images | |
run: docker compose build --parallel | |
- name: Push the Docker images | |
run: docker compose push | |
- name: Call repo lambda | |
run: | | |
curl --location --request POST '${{ secrets.LAMBDA_URL }}' --header 'Authorization: Bearer ${{ secrets.LAMBDA_TOKEN }}' | |