-
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.
- Loading branch information
Showing
9 changed files
with
96 additions
and
133 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,58 @@ | ||
--- | ||
name: Build | ||
name: docker | ||
|
||
on: | ||
pull_request: | ||
branches: [master] | ||
types: [opened, synchronize, reopened] | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository_owner }}/litmus-node-fault | ||
|
||
jobs: | ||
pre-checks: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Install golang | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.18 | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
#TODO: Add Dockerfile linting | ||
# Running go-lint | ||
- name: Checking Go-Lint | ||
run : | | ||
sudo apt-get update && sudo apt-get install golint | ||
make gotasks | ||
|
||
- name: gofmt check | ||
run: | | ||
if [ "$(gofmt -s -l . | wc -l)" -ne 0 ] | ||
then | ||
echo "The following files were found to be not go formatted:" | ||
gofmt -s -l . | ||
exit 1 | ||
fi | ||
- name: golangci-lint | ||
uses: reviewdog/action-golangci-lint@v1 | ||
|
||
build: | ||
needs: pre-checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Install golang | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.18 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
platforms: all | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- id: docker_meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
version: latest | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} | ||
tags: | | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
- id: docker_build | ||
name: Build and push Docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
push: false | ||
platforms: linux/amd64 | ||
push: true | ||
file: build/Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
tags: litmuschaos/go-runner:ci | ||
tags: ${{ steps.docker_meta.outputs.tags }} | ||
labels: ${{ steps.docker_meta.outputs.labels }} | ||
|
||
trivy: | ||
needs: pre-checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Install Cosign | ||
uses: sigstore/cosign-installer@main | ||
|
||
- name: Build an image from Dockerfile | ||
- name: Sign image with a key | ||
run: | | ||
docker build -f build/Dockerfile -t docker.io/litmuschaos/go-runner:${{ github.sha }} . --build-arg TARGETARCH=amd64 | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
image-ref: 'docker.io/litmuschaos/go-runner:${{ github.sha }}' | ||
format: 'table' | ||
exit-code: '1' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH' | ||
cosign sign --key env://COSIGN_PRIVATE_KEY ${IMAGE_NAME,,}@${IMAGE_DIGEST} --yes | ||
env: | ||
IMAGE_NAME: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} | ||
IMAGE_DIGEST: ${{ steps.docker_build.outputs.digest }} | ||
COSIGN_PRIVATE_KEY: ${{secrets.COSIGN_PRIVATE_KEY}} | ||
COSIGN_PASSWORD: ${{secrets.COSIGN_PASSWORD}} |
1 change: 1 addition & 0 deletions
1
.kube/cache/oidc-login/deaf9a37ba2dfa1293023b3f8cb2534bc7de187d5f46a0c730a4548dc612a80b
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 @@ | ||
{"id_token":"eyJhbGciOiJSUzI1NiIsImtpZCI6IjhlYTFiNWY1YzY5NDU2Y2MyZjVhNzM2MWYwZTQ5NzliIiwidHlwIjoiSldUIn0.eyJpc3MiOiJodHRwczovL2F1dGhlbnRpay52aXJhLnNoL2FwcGxpY2F0aW9uL28va3ViZXJuZXRlcy8iLCJzdWIiOiJ0b3BhaGFkemkiLCJhdWQiOiI1UkVDUkxrOHA0Wmh0TFJCTll5OWhpd3hiUTNZSFh2RHJCUnY4YlExIiwiZXhwIjoxNzAwMDMyMjEwLCJpYXQiOjE2OTk5NDU4MTAsImF1dGhfdGltZSI6MTY5OTk0NTgwOCwiYWNyIjoiZ29hdXRoZW50aWsuaW8vcHJvdmlkZXJzL29hdXRoMi9kZWZhdWx0Iiwibm9uY2UiOiJUcEFJSndvWkMxLUZRQkZzUHFVdnF6eE1UcGxOSnhWdWpfOWEySjUwRGc4IiwiYXRfaGFzaCI6IndzdlRDWVNvUnlSRkxnSnJrcWdDaUEiLCJuYW1lIjoiTXVzdGFwaGEgSGFkemkiLCJnaXZlbl9uYW1lIjoiTXVzdGFwaGEgSGFkemkiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0b3BhaGFkemkiLCJuaWNrbmFtZSI6InRvcGFoYWR6aSIsImdyb3VwcyI6WyJhdXRoZW50aWsvYWRtaW4iLCJhcmdvY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f7EAkCWFBDi5L8c"} |
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,4 @@ | ||
-----BEGIN PUBLIC KEY----- | ||
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEecYo6AqKFTb9su1Kcodys3hvO+Fl | ||
3R/vJCyD8/aQR39T+251p/4qCAsjsb4EJ/fWD5rbnilgBCbTIyIARVz7jQ== | ||
-----END PUBLIC KEY----- |
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