105 lines
2.6 KiB
YAML
105 lines
2.6 KiB
YAML
kube-builder: &install-kube-builder
|
|
golang_image: &golang_image
|
|
image: cimg/go:1.20
|
|
version: 2
|
|
jobs:
|
|
build:
|
|
docker:
|
|
- <<: *golang_image
|
|
steps:
|
|
- checkout
|
|
- run: make manager
|
|
test:
|
|
docker:
|
|
- <<: *golang_image
|
|
steps:
|
|
- checkout
|
|
- run: make test
|
|
test-integration:
|
|
machine: true
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
name: Install dependencies
|
|
command: |
|
|
make deps
|
|
- run:
|
|
name: Run integration tests
|
|
command: make test-integration
|
|
|
|
release:
|
|
docker:
|
|
- <<: *golang_image
|
|
steps:
|
|
- checkout
|
|
- run:
|
|
command: |
|
|
echo 'export DOCKER_FULL_TAG=$(echo $CIRCLE_TAG | tr '+' '_')' >> $BASH_ENV
|
|
echo 'export DOCKER_SHORT_TAG=$(echo $CIRCLE_TAG | cut -d '+' -f1)' >> $BASH_ENV
|
|
./.circleci/release_name.bash
|
|
source $BASH_ENV
|
|
- setup_remote_docker
|
|
- run:
|
|
docker login --username "$DOCKER_USERNAME" --password
|
|
"$DOCKER_PASSWORD"
|
|
- run: curl -sL https://git.io/goreleaser | bash
|
|
|
|
release-changelog:
|
|
docker:
|
|
- image: circleci/ruby:2.5-node
|
|
steps:
|
|
- checkout
|
|
- run: gem install github_changelog_generator -v 1.14.3
|
|
- run: sudo npm i -g doctoc
|
|
- run:
|
|
github_changelog_generator -u ory -p hydra-maester -o CHANGELOG.md
|
|
--token $GITHUB_TOKEN
|
|
- run: doctoc CHANGELOG.md
|
|
- run: doctoc README.md
|
|
- run: git config --global user.email "circleci@ory.am"
|
|
- run: git config --global user.name "ORY Continuous Integration"
|
|
- run: git add CHANGELOG.md
|
|
- run: git add README.md
|
|
- run: |
|
|
git commit -a -m "docs: Incorporates changes from version $(git describe --tags)" || true
|
|
- run: git remote rm origin
|
|
- run:
|
|
git remote add origin
|
|
https://arekkas:$GITHUB_TOKEN@github.com/ory/hydra-maester.git
|
|
- run: git push origin HEAD:master || true
|
|
|
|
workflows:
|
|
version: 2
|
|
"test, build and release":
|
|
jobs:
|
|
- build:
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
- test-integration:
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
- test:
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
- release:
|
|
requires:
|
|
- build
|
|
- test
|
|
- test-integration
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
branches:
|
|
ignore: /.*/
|
|
- release-changelog:
|
|
requires:
|
|
- release
|
|
filters:
|
|
tags:
|
|
only: /.*/
|
|
branches:
|
|
ignore: /.*/
|