-
Notifications
You must be signed in to change notification settings - Fork 319
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
Jerome Touffe-Blin
committed
Nov 27, 2023
1 parent
4e6e50f
commit df4c234
Showing
2 changed files
with
115 additions
and
22 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,86 @@ | ||
# Use the latest 2.1 version of CircleCI pipeline process engine. | ||
# See: https://circleci.com/docs/configuration-reference | ||
version: 2.1 | ||
|
||
orbs: | ||
go: circleci/[email protected] | ||
|
||
# Define a job to be invoked later in a workflow. | ||
# See: https://circleci.com/docs/configuration-reference/#jobs | ||
jobs: | ||
build-and-test: | ||
executor: | ||
name: go/default # Use the default executor from the orb | ||
tag: '1.21.4' # Specify a version tag | ||
# Add steps to the job | ||
# See: https://circleci.com/docs/configuration-reference/#steps | ||
steps: | ||
- checkout | ||
- go/load-cache # Load cached Go modules. | ||
- go/mod-download # Run 'go mod download'. | ||
- go/save-cache # Save Go modules to cache. | ||
- run: | ||
name: "install goveralls" | ||
command: go get -v github.com/mattn/goveralls | ||
- run: | ||
name: "install terminal" | ||
command: go get -v golang.org/x/crypto/ssh/terminal | ||
- run: | ||
name: "setup" | ||
command: make setup | ||
- run: | ||
name: "build and test" | ||
command: make build junit-test test-race check bench-race coveralls | ||
- store_test_results: | ||
path: test-report.xml | ||
docker-buildx: | ||
docker: # executor type | ||
- image: cimg/base:stable # primary container will run the latest, production-ready base image | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
docker_layer_caching: true | ||
- run: | ||
name: Docker build | ||
command: | | ||
docker login -u="$DOCKERHUB_USERNAME" -p="$DOCKERHUB_PASSWORD" | ||
make dockerx | ||
release: | ||
docker: # executor type | ||
- image: cimg/base:stable # primary container will run the latest, production-ready base image | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
docker_layer_caching: true | ||
- run: | ||
name: Docker push | ||
command: | | ||
if [ ! -z "$CIRCLE_TAG" ]; then | ||
docker login -u="$DOCKERHUB_USERNAME" -p="$DOCKERHUB_PASSWORD" | ||
echo "Executing release on tag build $CIRCLE_TAG" | ||
if [ "$CIRCLE_TAG" = "dev" ]; then | ||
make release-dev | ||
else | ||
make release-ci | ||
fi | ||
else | ||
echo "Not executing release on non-tag build" | ||
fi | ||
# Orchestrate jobs using workflows | ||
# See: https://circleci.com/docs/configuration-reference/#workflows | ||
workflows: | ||
kube2iam-workflow: | ||
jobs: | ||
- build-and-test | ||
- docker-buildx | ||
- release: | ||
requires: | ||
- build-and-test | ||
- docker-buildx | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
- /release-[\w\.]+/ | ||
|
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