Skip to content

Commit

Permalink
Adding support for main branch and also not pushing latest tag if fil…
Browse files Browse the repository at this point in the history
…e not exist
  • Loading branch information
missingcharacter committed Apr 3, 2021
1 parent 377dfb6 commit 276e812
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ This orb provides ready to use workflow jobs in three categories:
This job should be used for builds on `feature` branches only, as no artifacts are produced.

* `build_npm_and_release` - Build, test, and upload a NPM package to a NPM Registry for use by other packages
Use this job for builds on `master` or `develop` to prepare artifacts (packages) that can be used in other projects
Use this job for builds on `main`, `master` or `develop` to prepare artifacts (packages) that can be used in other projects
or integration tests.

* Pipenv (Python) builds
Expand All @@ -57,7 +57,7 @@ This orb provides ready to use workflow jobs in three categories:
This job should be used for builds on `feature` branches only, as no artifacts are produced.

* `build_pipenv_and_release` - Build, test, and upload a PyPi package (via Pipenv) to pypi registry for use by other packages
Use this job for builds on `master` or `develop` to prepare artifacts (packages) that can be used in other projects
Use this job for builds on `main`, `master` or `develop` to prepare artifacts (packages) that can be used in other projects

## Example dependent CircleCi task

Expand Down Expand Up @@ -123,7 +123,7 @@ examples:
filters:
branches:
only:
- master
- main
- develop
```

Expand Down
12 changes: 7 additions & 5 deletions src/orb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ references:
docker build -t "${DOCKER_TAG}" .
echo "${DOCKER_TAG}" > .docker_tag
if [ ! -z "${CIRCLE_BRANCH}" ]; then
if [ $CIRCLE_BRANCH = "master" ]; then
ENVIRONMENT="master"
if [ $CIRCLE_BRANCH = "master" || $CIRCLE_BRANCH = main ]; then
ENVIRONMENT="main"
elif [ $CIRCLE_BRANCH = "develop" ]; then
ENVIRONMENT="develop"
else
Expand All @@ -394,7 +394,10 @@ references:
<<: *common_step_params
command: |
docker push "$(cat .docker_tag)"
docker push "$(cat .docker_latest_tag)"
if [ -e .docker_latest_tag ]; then
echo '.docker_latest_tag file exists, I will try to push tag now'
docker push "$(cat .docker_latest_tag)"
fi
#
# Commands - CircleCI build steps that can be referenced by name in a job
Expand Down Expand Up @@ -664,7 +667,6 @@ executors:
docker:
# Build agent for creating Docker images. Slower to start, but infinitely flexible
machine:
docker_layer_caching: true
resource_class: medium
image: ubuntu-2004:202101-01

Expand Down Expand Up @@ -988,5 +990,5 @@ examples:
filters:
branches:
only:
- master
- main
- develop

0 comments on commit 276e812

Please sign in to comment.