forked from kubearmor/KubeArmor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: rksharma95 <[email protected]>
- Loading branch information
1 parent
3bf3123
commit 86a581a
Showing
16 changed files
with
194 additions
and
113 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: ci-release-operator | ||
|
||
on: | ||
push: | ||
branches: | ||
- "feat-snitch-image" | ||
- "v*" | ||
paths: | ||
# release on any dependency change | ||
- "pkg/**" | ||
- "deployments/get/**" | ||
- "KubeArmor/utils/**" | ||
create: | ||
branches: | ||
- "v*" | ||
|
||
|
||
env: | ||
PLATFORM: linux/amd64,linux/arm64/v8 | ||
|
||
jobs: | ||
kubearmor-operator-release: | ||
name: Build & Push KubeArmor Operator | ||
if: github.repository == 'rksharma95/kubearmor' | ||
defaults: | ||
run: | ||
working-directory: ./pkg/KubeArmorOperator | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: "v1.20" | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
platforms: linux/amd64,linux/arm64/v8 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_AUTHTOK }} | ||
|
||
- name: Get Tag | ||
id: vars | ||
run: | | ||
if [ ${{ github.ref }} == "refs/heads/feat-snitch-image" ]; then | ||
echo "tag=latest" >> $GITHUB_OUTPUT | ||
echo "stable=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | ||
value=`cat STABLE-RELEASE` | ||
if [ ${{ github.ref }} == "refs/heads/$value" ]; then | ||
echo "stable=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "stable=false" >> $GITHUB_OUTPUT | ||
fi | ||
fi | ||
- name: Build & Push KubeArmor Operator | ||
if: ${{ github.ref }} == 'refs/heads/feat-snitch-image' && ${{ steps.vars.outputs.stable }} == 'false' | ||
run: PLATFORM=$PLATFORM make docker-buildx TAG=${{ steps.vars.outputs.tag }} | ||
|
||
- name: Install regctl | ||
if: steps.vars.outputs.stable == 'true' | ||
run: | | ||
curl -L https://github.com/regclient/regclient/releases/latest/download/regctl-linux-amd64 >regctl | ||
chmod 755 regctl | ||
mv regctl /usr/local/bin | ||
- name: Check install | ||
if: steps.vars.outputs.stable == 'true' | ||
run: regctl version | ||
|
||
- name: Generate the stable version of KubeArmor in Docker Hub | ||
if: steps.vars.outputs.stable == 'true' | ||
run: | | ||
STABLE_VERSION=`cat STABLE-RELEASE` | ||
regctl image copy kubearmor/kubearmor-operator:$STABLE_VERSION kubearmor/kubearmor-operator:stable --digest-tags | ||
regctl image copy kubearmor/kubearmor-snitch:$STABLE_VERSION kubearmor/kubearmor-snitch:stable --digest-tags |
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.