Skip to content

Commit

Permalink
fix: circle ci improvements to run release only on tag filtering, and…
Browse files Browse the repository at this point in the history
… builds based on path filtering (#23)
  • Loading branch information
jelias2 authored Jun 28, 2024
1 parent d7aab1d commit ec496f5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 2.1
setup: true

orbs:
path-filtering: circleci/path-filtering@0.1.1
path-filtering: circleci/path-filtering@1.0.0

workflows:
check-updated-files:
Expand All @@ -20,6 +20,9 @@ workflows:
proxyd/.* run-build-proxyd true
.circleci/.* run-all true
.github/.* run-all true
filters:
tags:
only: /.*/

base-revision: main
# this is the path of the configuration we should trigger once
Expand Down
37 changes: 22 additions & 15 deletions .circleci/continue_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ orbs:
go: circleci/go@1.9.0
gcp-cli: circleci/gcp-cli@2.4.1
shellcheck: circleci/shellcheck@3.1.2
path-filtering: circleci/path-filtering@0.1.1
path-filtering: circleci/path-filtering@1.0.0

parameters:
run-build-op-conductor-mon:
Expand Down Expand Up @@ -67,6 +67,8 @@ jobs:
log-config-results:
docker:
- image: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:latest # only used to enable codecov.
environment:
CURRENT_TAG: << pipeline.git.tag >>
steps:
- checkout
- run:
Expand All @@ -83,7 +85,6 @@ jobs:
echo "Is not a scheduled pipeline: $([ "<< pipeline.trigger_source >>" != "scheduled_pipeline" ] && echo "true" || echo "false")"
echo ""
echo "Tag Information:"
CURRENT_TAG=$(git describe --tags --exact-match 2> /dev/null || echo "No tag")
echo "Current tag: $CURRENT_TAG"
# Use the same regex patterns as defined in the YAML anchors
Expand Down Expand Up @@ -385,7 +386,12 @@ jobs:
workflows:
logging:
jobs:
- log-config-results
- log-config-results:
filters:
tags:
only: /.*/
branches:
ignore: /.*/
op-conductor-mon:
when:
or: [<< pipeline.parameters.run-build-op-conductor-mon >>, << pipeline.parameters.run-all >>]
Expand Down Expand Up @@ -435,10 +441,13 @@ workflows:
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
docker_context: .
release:
when:
not:
equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
jobs:
- log-config-results:
filters:
tags:
only: /^(proxyd|ufm-[a-z0-9\-]*|op-[a-z0-9\-]*)\/v.*/
branches:
ignore: /.*/
- hold:
type: approval
filters:
Expand All @@ -451,8 +460,6 @@ workflows:
filters:
tags:
only: /^op-ufm\/v.*/
branches:
ignore: /.*/
docker_name: op-ufm
docker_tags: <<pipeline.git.revision>>
docker_context: .
Expand All @@ -466,17 +473,14 @@ workflows:
docker_name: op-ufm
docker_tags: <<pipeline.git.revision>>
context:
- oplabs-gcr
- oplabs-gcr-release
requires:
- op-ufm-docker-build

- docker-build:
name: proxyd-docker-build
filters:
tags:
only: /^proxyd\/v.*/
branches:
ignore: /.*/
docker_name: proxyd
docker_tags: <<pipeline.git.revision>>
docker_context: .
Expand All @@ -490,8 +494,6 @@ workflows:
filters:
tags:
only: /^proxyd\/v.*/
branches:
ignore: /.*/
docker_name: proxyd
docker_tags: <<pipeline.git.revision>>
context:
Expand All @@ -501,17 +503,22 @@ workflows:

- docker-build:
name: op-conductor-mon-docker-build
filters:
tags:
only: /^op-conductor-mon\/v.*/
docker_file: op-conductor-mon/Dockerfile
docker_name: op-conductor-mon
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
docker_context: .
context:
- oplabs-gcr-release
requires:
- hold
- docker-publish:
name: op-conductor-mon-docker-publish
docker_name: op-conductor-mon
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
context:
- oplabs-gcr
- oplabs-gcr-release
requires:
- op-conductor-mon-docker-build

0 comments on commit ec496f5

Please sign in to comment.