-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore(refactor): Modify Chaos CI Lib use actions, remove vendors, ref…
…actor code (#10) * Chore(refactor): Modify Chaos CI Lib use actions, remove vendors, refactor code Signed-off-by: uditgaurav <[email protected]> * Inital commit to the repo Signed-off-by: uditgaurav <[email protected]>
- Loading branch information
1 parent
07859ce
commit c970021
Showing
2,133 changed files
with
2,752 additions
and
909,064 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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
name: Build | ||
on: | ||
pull_request: | ||
branches: [master] | ||
types: [opened, synchronize, reopened] | ||
|
||
env: | ||
REPONAME: litmuschaos | ||
IMAGENAME: chaos-ci-lib | ||
IMAGETAG: ci | ||
|
||
jobs: | ||
pre-checks: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Install golang | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14 | ||
|
||
# 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 | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
# Install golang | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14 | ||
|
||
# Checkout to the latest commit | ||
# On specific directory/path | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build Docker Image | ||
env: | ||
DOCKER_REPO: ${{ env.REPONAME }} | ||
DOCKER_IMAGE: ${{ env.IMAGENAME }} | ||
DOCKER_TAG: ${{ env.IMAGETAG }} | ||
run: | | ||
make build | ||
security-scan: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
image-ref: 'docker.io/${{ env.REPONAME }}/${{ env.IMAGENAME }}:${{ env.IMAGETAG }}' | ||
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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
--- | ||
name: Push | ||
on: | ||
push: | ||
branches: | ||
- master | ||
tags-ignore: | ||
- '**' | ||
|
||
env: | ||
REPONAME: litmuschaos | ||
IMAGENAME: chaos-ci-lib | ||
IMAGETAG: ci | ||
|
||
jobs: | ||
pre-checks: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Install golang | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14 | ||
|
||
# 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 | ||
|
||
push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
# Install golang | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14 | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Login to GitHub Container Registry | ||
run: echo ${{ secrets.DPASS }} | docker login -u ${{ secrets.DNAME }} --password-stdin | ||
|
||
- name: Build Docker Image | ||
env: | ||
DOCKER_REPO: ${{ env.REPONAME }} | ||
DOCKER_IMAGE: go-runner | ||
DOCKER_TAG: ${{ env.IMAGETAG }} | ||
run: | | ||
make build | ||
- name: Push Docker Image | ||
env: | ||
DOCKER_REPO: ${{ env.REPONAME }} | ||
DOCKER_IMAGE: go-runner | ||
DOCKER_TAG: ${{ env.IMAGETAG }} | ||
run: | | ||
make push | ||
security-scan: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
image-ref: 'docker.io/${{ env.REPONAME }}/${{ env.IMAGENAME }}:${{ env.IMAGETAG }}' | ||
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Release | ||
on: | ||
create: | ||
tags: | ||
- '**' | ||
env: | ||
REPONAME: litmuschaos | ||
IMAGENAME: chaos-ci-lib | ||
IMAGETAG: ci | ||
|
||
jobs: | ||
pre-checks: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Install golang | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14 | ||
|
||
# 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 | ||
|
||
image-build: | ||
runs-on: ubuntu-latest | ||
needs: pre-checks | ||
steps: | ||
# Checkout to the latest commit | ||
# On specific directory/path | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: login to GitHub Container Registry | ||
run: echo ${{ secrets.DPASS }} | docker login -u ${{ secrets.DNAME }} --password-stdin | ||
|
||
- name: Set Tag | ||
run: | | ||
TAG="${GITHUB_REF#refs/*/}" | ||
echo "TAG=${TAG}" >> $GITHUB_ENV | ||
echo "RELEASE_TAG=${TAG}" >> $GITHUB_ENV | ||
- name: Build & Push Docker Image with version tag | ||
env: | ||
DOCKER_REPO: ${{ env.REPONAME }} | ||
DOCKER_IMAGE: ${{ env.IMAGENAME }} | ||
DOCKER_TAG: ${RELEASE_TAG} | ||
DNAME: ${{ secrets.DNAME }} | ||
DPASS: ${{ secrets.DPASS }} | ||
run: | | ||
make push | ||
- name: Build & Push Docker Image with latest tag | ||
env: | ||
DOCKER_REPO: ${{ env.REPONAME }} | ||
DOCKER_IMAGE: ${{ env.IMAGENAME }} | ||
DOCKER_TAG: latest | ||
DNAME: ${{ secrets.DNAME }} | ||
DPASS: ${{ secrets.DPASS }} | ||
run: | | ||
make push | ||
security-scan: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
image-ref: 'docker.io/${{ env.REPONAME }}/${{ env.IMAGENAME }}:${{ env.IMAGETAG }}' | ||
format: 'table' | ||
exit-code: '0' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
severity: 'CRITICAL,HIGH' |
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
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
Oops, something went wrong.