-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(label): Adding chaosengine name as filter label (#87) Signed-off-by: shubhamchaudhary <[email protected]> * Refactor CI/CD scripts, Dockerfile and remove vendor directory (#88) * refactore chaos exporter ci/cd scripts Signed-off-by: Raj Das <[email protected]> * minor fix in github workflow (push script) (#89) * minor fix in github workflow Signed-off-by: rajdas98 <[email protected]> * fixing github worklglows Signed-off-by: rajdas98 <[email protected]> Co-authored-by: Raj Babu Das <[email protected]>
- Loading branch information
1 parent
5026b4f
commit 7dc2817
Showing
2,534 changed files
with
353 additions
and
1,009,885 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,61 +1,81 @@ | ||
--- | ||
name: Build | ||
on: | ||
pull_request: | ||
branches: [master] | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
lint: | ||
pre-checks: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Install golang | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '^1.13.1' | ||
go-version: 1.14 | ||
|
||
# Setup gopath | ||
- name: Setting up GOPATH | ||
# Checkout to the latest commit | ||
# On specific directory/path | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: gofmt check | ||
run: | | ||
echo "GOPATH=${GITHUB_WORKSPACE}/go" >> $GITHUB_ENV | ||
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 | ||
|
||
- name: unused-package check | ||
run: | | ||
make unused-package-check | ||
image-build: | ||
runs-on: ubuntu-latest | ||
needs: pre-checks | ||
steps: | ||
# Checkout to the latest commit | ||
# On specific directory/path | ||
- uses: actions/checkout@v2 | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
with: | ||
path: go/src/github.com/${{github.repository}} | ||
version: latest | ||
|
||
#TODO: Add Dockerfile linting | ||
# Running go-lint | ||
- name: Checking Go-Lint | ||
run : | | ||
sudo apt-get update && sudo apt-get install golint | ||
cd go/src/github.com/${{github.repository}} | ||
make format | ||
make lint | ||
- name: Build Docker Image | ||
env: | ||
DOCKER_REPO: litmuschaos | ||
DOCKER_IMAGE: chaos-exporter | ||
DOCKER_TAG: ci | ||
run: | | ||
make build-chaos-exporter | ||
tests: | ||
runs-on: ubuntu-latest | ||
needs: pre-checks | ||
steps: | ||
# Install golang | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '^1.13.1' | ||
|
||
# Setup gopath | ||
- name: Setting up GOPATH | ||
run: | | ||
echo "GOPATH=${GITHUB_WORKSPACE}/go" >> $GITHUB_ENV | ||
go-version: 1.14 | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
path: go/src/github.com/${{github.repository}} | ||
# Checkout to the latest commit | ||
# On specific directory/path | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
#Install and configure a kind cluster | ||
- name: Installing Prerequisites (KinD Cluster) | ||
uses: engineerd/[email protected] | ||
with: | ||
version: "v0.7.0" | ||
version: "v0.7.0" | ||
|
||
- name: Configuring and testing the Installation | ||
run: | | ||
|
@@ -65,57 +85,22 @@ jobs: | |
- name: Dependency checks | ||
run: | | ||
cd go/src/github.com/${{github.repository}} | ||
make deps | ||
- name: Running Go BDD Test | ||
run: | | ||
cd go/src/github.com/${{github.repository}} | ||
make test | ||
- name: Trivy Security Check | ||
run: | | ||
cd go/src/github.com/${{github.repository}} | ||
wget https://github.com/aquasecurity/trivy/releases/download/v0.11.0/trivy_0.11.0_Linux-64bit.tar.gz | ||
tar zxvf trivy_0.11.0_Linux-64bit.tar.gz | ||
make security-checks | ||
image: | ||
security-scan: | ||
runs-on: ubuntu-latest | ||
needs: pre-checks | ||
steps: | ||
|
||
# Install golang | ||
- uses: actions/setup-go@v2 | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
go-version: '^1.13.1' | ||
|
||
# Setup gopath | ||
- name: Setting up GOPATH | ||
run: | | ||
echo "GOPATH=${GITHUB_WORKSPACE}/go" >> $GITHUB_ENV | ||
# Checkout to the latest commit | ||
# On specific directory/path | ||
- uses: actions/checkout@v2 | ||
with: | ||
path: go/src/github.com/${{github.repository}} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
with: | ||
platforms: all | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
with: | ||
version: latest | ||
|
||
- name: Build Docker Image | ||
env: | ||
DOCKER_REPO: litmuschaos | ||
DOCKER_IMAGE: chaos-exporter | ||
DOCKER_TAG: ci | ||
run: | | ||
cd go/src/github.com/${{github.repository}} | ||
make build | ||
image-ref: 'docker.io/litmuschaos/chaos-exporter:ci' | ||
format: 'table' | ||
exit-code: '0' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH' |
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,4 +1,3 @@ | ||
--- | ||
name: Push | ||
on: | ||
push: | ||
|
@@ -8,56 +7,87 @@ on: | |
- '**' | ||
|
||
jobs: | ||
lint: | ||
pre-checks: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Install golang | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '^1.13.1' | ||
go-version: 1.14 | ||
|
||
# Setup gopath | ||
- name: Setting up GOPATH | ||
# Checkout to the latest commit | ||
# On specific directory/path | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- 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 | ||
|
||
- name: unused-package check | ||
run: | | ||
echo "GOPATH=${GITHUB_WORKSPACE}/go" >> $GITHUB_ENV | ||
make unused-package-check | ||
image-build: | ||
runs-on: ubuntu-latest | ||
needs: pre-checks | ||
steps: | ||
# Checkout to the latest commit | ||
# On specific directory/path | ||
- uses: actions/checkout@v2 | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
with: | ||
platforms: all | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
with: | ||
path: go/src/github.com/${{github.repository}} | ||
version: latest | ||
|
||
- name: login to GitHub Container Registry | ||
run: echo ${{ secrets.DPASS }} | docker login -u ${{ secrets.DNAME }} --password-stdin | ||
|
||
#TODO: Add Dockerfile linting | ||
# Running go-lint | ||
- name: Checking Go-Lint | ||
run : | | ||
sudo apt-get update && sudo apt-get install golint | ||
cd go/src/github.com/${{github.repository}} | ||
make format | ||
make lint | ||
- name: Build & Push Docker Image | ||
env: | ||
DOCKER_REPO: litmuschaos | ||
DOCKER_IMAGE: chaos-exporter | ||
DOCKER_TAG: ci | ||
DNAME: ${{ secrets.DNAME }} | ||
DPASS: ${{ secrets.DPASS }} | ||
run: | | ||
make push-chaos-exporter | ||
tests: | ||
needs: pre-checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checkout to the latest commit | ||
# On specific directory/path | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
# Install golang | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '^1.13.1' | ||
|
||
# Setup gopath | ||
- name: Setting up GOPATH | ||
run: | | ||
echo "GOPATH=${GITHUB_WORKSPACE}/go" >> $GITHUB_ENV | ||
- uses: actions/checkout@v2 | ||
with: | ||
path: go/src/github.com/${{github.repository}} | ||
go-version: 1.14 | ||
|
||
#Install and configure a kind cluster | ||
- name: Installing Prerequisites (KinD Cluster) | ||
uses: engineerd/[email protected] | ||
with: | ||
version: "v0.7.0" | ||
version: "v0.7.0" | ||
|
||
- name: Configuring and testing the Installation | ||
run: | | ||
|
@@ -67,60 +97,22 @@ jobs: | |
- name: Dependency checks | ||
run: | | ||
cd go/src/github.com/${{github.repository}} | ||
make deps | ||
- name: Running Go BDD Test | ||
run: | | ||
cd go/src/github.com/${{github.repository}} | ||
make test | ||
- name: Trivy Security Check | ||
run: | | ||
cd go/src/github.com/${{github.repository}} | ||
wget https://github.com/aquasecurity/trivy/releases/download/v0.11.0/trivy_0.11.0_Linux-64bit.tar.gz | ||
tar zxvf trivy_0.11.0_Linux-64bit.tar.gz | ||
make security-checks | ||
image: | ||
security-scan: | ||
needs: pre-checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
# Install golang | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '^1.13.1' | ||
|
||
# Setup gopath | ||
- name: Setting up GOPATH | ||
run: | | ||
echo "GOPATH=${GITHUB_WORKSPACE}/go" >> $GITHUB_ENV | ||
# Checkout to the latest commit | ||
# On specific directory/path | ||
- uses: actions/checkout@v2 | ||
with: | ||
path: go/src/github.com/${{github.repository}} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
platforms: all | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
with: | ||
version: latest | ||
|
||
- name: Build Docker Image | ||
env: | ||
DOCKER_REPO: litmuschaos | ||
DOCKER_IMAGE: chaos-exporter | ||
DOCKER_TAG: ci | ||
DNAME: ${{ secrets.DNAME }} | ||
DPASS: ${{ secrets.DPASS }} | ||
run: | | ||
cd go/src/github.com/${{github.repository}} | ||
make go-build | ||
make push | ||
image-ref: 'docker.io/litmuschaos/chaos-exporter:ci' | ||
format: 'table' | ||
exit-code: '0' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH' |
Oops, something went wrong.