mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-27 07:48:55 +00:00
Merge pull request #1649 from fidencio/wip/stable-2.0-cherry-pick-github-kata-deploy-stuff
stable-2.0 | cherry-pick fixes for test-kata-deploy GitHub actions
This commit is contained in:
commit
6d5e47bab1
26
.github/workflows/kata-deploy-test.yaml
vendored
26
.github/workflows/kata-deploy-test.yaml
vendored
@ -1,7 +1,12 @@
|
|||||||
on: issue_comment
|
on:
|
||||||
|
issue_comment:
|
||||||
|
types: [created, edited]
|
||||||
|
|
||||||
name: test-kata-deploy
|
name: test-kata-deploy
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check_comments:
|
check_comments:
|
||||||
|
if: ${{ github.event.issue.pull_request }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check for Command
|
- name: Check for Command
|
||||||
@ -9,7 +14,7 @@ jobs:
|
|||||||
uses: kata-containers/slash-command-action@v1
|
uses: kata-containers/slash-command-action@v1
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
command: "test-kata-deploy"
|
command: "test_kata_deploy"
|
||||||
reaction: "true"
|
reaction: "true"
|
||||||
reaction-type: "eyes"
|
reaction-type: "eyes"
|
||||||
allow-edits: "false"
|
allow-edits: "false"
|
||||||
@ -17,6 +22,7 @@ jobs:
|
|||||||
- name: verify command arg is kata-deploy
|
- name: verify command arg is kata-deploy
|
||||||
run: |
|
run: |
|
||||||
echo "The command was '${{ steps.command.outputs.command-name }}' with arguments '${{ steps.command.outputs.command-arguments }}'"
|
echo "The command was '${{ steps.command.outputs.command-name }}' with arguments '${{ steps.command.outputs.command-arguments }}'"
|
||||||
|
|
||||||
create-and-test-container:
|
create-and-test-container:
|
||||||
needs: check_comments
|
needs: check_comments
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -27,22 +33,26 @@ jobs:
|
|||||||
ref=$(cat $GITHUB_EVENT_PATH | jq -r '.issue.pull_request.url' | sed 's#^.*\/pulls#refs\/pull#' | sed 's#$#\/merge#')
|
ref=$(cat $GITHUB_EVENT_PATH | jq -r '.issue.pull_request.url' | sed 's#^.*\/pulls#refs\/pull#' | sed 's#$#\/merge#')
|
||||||
echo "reference for PR: " ${ref}
|
echo "reference for PR: " ${ref}
|
||||||
echo "##[set-output name=pr-ref;]${ref}"
|
echo "##[set-output name=pr-ref;]${ref}"
|
||||||
- uses: actions/checkout@v2-beta
|
|
||||||
|
- name: check out
|
||||||
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
ref: ${{ steps.get-PR-ref.outputs.pr-ref }}
|
ref: ${{ steps.get-PR-ref.outputs.pr-ref }}
|
||||||
|
|
||||||
- name: build-container-image
|
- name: build-container-image
|
||||||
id: build-container-image
|
id: build-container-image
|
||||||
run: |
|
run: |
|
||||||
PR_SHA=$(git log --format=format:%H -n1)
|
PR_SHA=$(git log --format=format:%H -n1)
|
||||||
VERSION=$(curl https://raw.githubusercontent.com/kata-containers/kata-containers/main/VERSION)
|
VERSION="2.0.0"
|
||||||
ARTIFACT_URL="https://github.com/kata-containers/kata-containers/releases/download/${VERSION}/kata-static-${VERSION}-x86_64.tar.xz"
|
ARTIFACT_URL="https://github.com/kata-containers/kata-containers/releases/download/${VERSION}/kata-static-${VERSION}-x86_64.tar.xz"
|
||||||
wget "${ARTIFACT_URL}" -O ./kata-deploy/kata-static.tar.xz
|
wget "${ARTIFACT_URL}" -O tools/packaging/kata-deploy/kata-static.tar.xz
|
||||||
docker build --build-arg KATA_ARTIFACTS=kata-static.tar.xz -t katadocker/kata-deploy-ci:${PR_SHA} ./kata-deploy
|
docker build --build-arg KATA_ARTIFACTS=kata-static.tar.xz -t katadocker/kata-deploy-ci:${PR_SHA} ./tools/packaging/kata-deploy
|
||||||
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
|
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
|
||||||
docker push katadocker/kata-deploy-ci:$PR_SHA
|
docker push katadocker/kata-deploy-ci:$PR_SHA
|
||||||
echo "##[set-output name=pr-sha;]${PR_SHA}"
|
echo "##[set-output name=pr-sha;]${PR_SHA}"
|
||||||
|
|
||||||
- name: test-kata-deploy-ci-in-aks
|
- name: test-kata-deploy-ci-in-aks
|
||||||
uses: ./kata-deploy/action
|
uses: ./tools/packaging/kata-deploy/action
|
||||||
with:
|
with:
|
||||||
packaging-sha: ${{ steps.build-container-image.outputs.pr-sha }}
|
packaging-sha: ${{ steps.build-container-image.outputs.pr-sha }}
|
||||||
env:
|
env:
|
||||||
|
Loading…
Reference in New Issue
Block a user