Skip to content

Commit

Permalink
fix documentation as needed, remove obsolete comment in Circle config…
Browse files Browse the repository at this point in the history
…, and fix logging to reflect actual official release checklist rules
  • Loading branch information
forgo committed Feb 25, 2020
1 parent a2ea36c commit 7ca14ce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ jobFilters: &jobFilters
filters:
tags:
only: /.*/
#only: /(?<=^[Vv]|^)(?:(?<major>(?:0|[1-9](?:(?:0|[1-9])+)*))[.](?<minor>(?:0|[1-9](?:(?:0|[1-9])+)*))[.](?<patch>(?:0|[1-9](?:(?:0|[1-9])+)*))(?:-(?<prerelease>(?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:0|[1-9](?:(?:0|[1-9])+)*))(?:[.](?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:0|[1-9](?:(?:0|[1-9])+)*)))*))?(?:[+](?<build>(?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:(?:0|[1-9])+))(?:[.](?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:(?:0|[1-9])+)))*))?)$/

version: 2
jobs:
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Publishing.kt
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ fun logInfo(ci: CI, registry: Registry, version: String) {

val logReleaseCI: String = """
[Official Release]
✓ in CI environment
✓ in CI environment (${ci.info.label})
✓ tag has 'v' prefix before version
✓ version is semantic without '$SUFFIX_SNAPSHOT' suffix
building on release branch = '$BRANCH_MASTER'
${ci.info.envBranch}='${branchCI}', as expected for tagged builds in ${ci.info.label}
""".trimIndent()

val logReleaseLocal: String = """
Expand Down
6 changes: 3 additions & 3 deletions docs/developer/publishing-tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ For Circle CI to [triggers builds from tags](https://circleci.com/docs/2.0/confi

The `branches` filter is not used because we want all branches to trigger a Circle CI Build, and we rely on gradle to set the version/tag appropriately based on environment.

The job `tags` filter is defined for every job to prevent -- as much as possible -- random tags from triggering a build/publish. The insanely long regex is a way to capture only tags that match the semantic versioning format; however, gradle still ensures other constraints are met before officially pushing to the container registry.
The job `tags` filter is defined for every job, in accordance with the CircleCI reference above. For simplicity, any tag is allowed to trigger a build, but the publishing logic will prevent tags containing non-semantic versions from getting published as such.

```
jobFilters: &jobFilters
filters:
tags:
only: /(?<=^[Vv]|^)(?:(?<major>(?:0|[1-9](?:(?:0|[1-9])+)*))[.](?<minor>(?:0|[1-9](?:(?:0|[1-9])+)*))[.](?<patch>(?:0|[1-9](?:(?:0|[1-9])+)*))(?:-(?<prerelease>(?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:0|[1-9](?:(?:0|[1-9])+)*))(?:[.](?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:0|[1-9](?:(?:0|[1-9])+)*)))*))?(?:[+](?<build>(?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:(?:0|[1-9])+))(?:[.](?:(?:(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?|(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)(?:[A-Za-z]|-)(?:(?:(?:0|[1-9])|(?:[A-Za-z]|-))+)?)|(?:(?:0|[1-9])+)))*))?)$/
only: /.*/
workflows:
version: 2
Expand All @@ -55,7 +55,7 @@ workflows:
## Continuous Integration Automation

Many CI environments, including Circle CI set an environment variable `CI` to facilitate detecting the environment of the build. In the case that we have detected `CI=true`:
- if build is tagged `CIRCLE_TAG=v?` and `CIRCLE_BRANCH=master`
- if build is tagged `CIRCLE_TAG=v?` and `CIRCLE_BRANCH=` (other CI environments may set the branch, but CircleCI does not on tagged builds)
- set `jib`'s `to` image to:
- `"${version}"` (`CIRCLE_TAG` must be semantic version without the 'v' prefix)
- else (tag is non-semantic or non-existent):
Expand Down

0 comments on commit 7ca14ce

Please sign in to comment.