Skip to content

Commit

Permalink
combine publish and deploy workflow; add test-devnet target (#2402)
Browse files Browse the repository at this point in the history
combining publish and deploy workflow reduces duplicated build_linux jobs running, increasing execution time.

allow targetting test-devnet OR user-devnet to add permanent test-devnet Continuous Deployment capabilities
  • Loading branch information
ognots authored and gmasgras committed Mar 25, 2019
1 parent 3691d38 commit 5965fd3
Showing 1 changed file with 126 additions and 54 deletions.
180 changes: 126 additions & 54 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ params:
description: "job is being invoked from user devnet workflow"
type: boolean
default: false
test_devnet_param: &test_devnet_param
test_devnet:
description: "job is being invoked from test devnet workflow"
type: boolean
default: false

commands:
rust_fil_proofs_checksum:
Expand Down Expand Up @@ -84,7 +89,12 @@ commands:
name: read and export user devnet FILECOIN_BINARY_VERSION
command: |
echo "export FILECOIN_BINARY_VERSION="${CIRCLE_TAG}"" >> $BASH_ENV
get_test_devnet_version:
steps:
- run:
name: read and export test devnet FILECOIN_BINARY_VERSION
command: |
echo "export FILECOIN_BINARY_VERSION="${CIRCLE_TAG}"" >> $BASH_ENV
trigger_infra_build:
parameters:
branch:
Expand Down Expand Up @@ -415,6 +425,7 @@ jobs:
parameters:
<<: *nightly_param
<<: *user_devnet_param
<<: *test_devnet_param
working_directory: "~/docker_build"
steps:
- add_ssh_keys:
Expand Down Expand Up @@ -463,6 +474,11 @@ jobs:
steps:
- get_user_devnet_version

- when:
condition: << parameters.test_devnet >>
steps:
- get_test_devnet_version

- run:
name: build & push image - genesis file server
command: |
Expand Down Expand Up @@ -530,22 +546,31 @@ jobs:
filename: "nightly-devnet.json"


trigger_user_devnet_deploy:
trigger_devnet_deploy:
parameters:
network:
type: string
default: test
<<: *user_devnet_param
<<: *test_devnet_param
docker:
- image: circleci/golang:latest
resource_class: small
steps:
- checkout
- get_user_devnet_version
- when:
condition: << parameters.user_devnet >>
steps:
- get_user_devnet_version
- when:
condition: << parameters.test_devnet >>
steps:
- get_test_devnet_version
- trigger_infra_build:
job: deploy_user_devnet
branch: filecoin-testnet
# @TODO Remove the line above and uncomment below when testing complete
# branch: filecoin-usernet
job: deploy_<< parameters.network >>_devnet
branch: filecoin-<< parameters.network >>net
- update_badge:
filename: "test-devnet.json"
# @TODO Remove the line above and uncomment below when testing complete
# filename: "user-devnet.json"
filename: "<< parameters.network >>-devnet.json"

workflows:
version: 2
Expand Down Expand Up @@ -592,7 +617,38 @@ workflows:
- build_linux:
sector_builder_tests: true

build_and_publish_release:
build_nightly_devnet:
triggers:
- schedule:
# every day at 6:00 UTC
cron: "0 6 * * *"
filters:
branches:
only:
- master
jobs:
- build_linux:
nightly: true
- build_macos
- build_faucet_and_genesis:
requires:
- build_linux
- build_docker_img:
nightly: true
requires:
- build_linux
- build_faucet_and_genesis
- trigger_nightly_devnet_deploy:
requires:
- build_docker_img
- publish_release:
nightly: true
requires:
- build_linux
- build_macos
- trigger_nightly_devnet_deploy

build_user_devnet:
jobs:
- build_macos:
filters:
Expand All @@ -601,9 +657,7 @@ workflows:
- /.*/
tags:
only:
# - /^\d+\.\d+\.\d+$/
# @TODO remove the following line and uncomment above after deploy testing complete
- /^(test\-devnet\-)*\d+\.\d+\.\d+$/
- /^\d+\.\d+\.\d+$/

- build_linux:
filters:
Expand All @@ -612,65 +666,75 @@ workflows:
- /.*/
tags:
only:
# - /^\d+\.\d+\.\d+$/
# @TODO remove the following line and uncomment above after deploy testing complete
- /^(test\-devnet\-)*\d+\.\d+\.\d+$/
- publish_release:
- /^\d+\.\d+\.\d+$/

- build_faucet_and_genesis:
requires:
- build_linux
- build_macos
filters:
branches:
ignore:
- /.*/
tags:
only:
# - /^\d+\.\d+\.\d+$/
# @TODO remove the following line and uncomment above after deploy testing complete
- /^(test\-devnet\-)*\d+\.\d+\.\d+$/
- /^\d+\.\d+\.\d+$/

build_nightly_devnet:
triggers:
- schedule:
# every day at 6:00 UTC
cron: "0 6 * * *"
- publish_release:
requires:
- build_linux
- build_macos
filters:
branches:
ignore:
- /.*/
tags:
only:
- master
jobs:
- build_linux:
nightly: true
- build_macos
- build_faucet_and_genesis:
requires:
- build_linux
- /^\d+\.\d+\.\d+$/

- build_docker_img:
nightly: true
user_devnet: true
requires:
- build_linux
- build_faucet_and_genesis
- trigger_nightly_devnet_deploy:
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^\d+\.\d+\.\d+$/

- trigger_devnet_deploy:
user_devnet: true
network: "user"
requires:
- build_docker_img
- publish_release:
nightly: true
requires:
- build_linux
- build_macos
- trigger_nightly_devnet_deploy
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^\d+\.\d+\.\d+$/

build_user_devnet:
build_test_devnet:
jobs:
- build_macos:
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^(test\-devnet\-)*\d+\.\d+\.\d+$/

- build_linux:
filters:
branches:
ignore:
- /.*/
tags:
only:
# - /^\d+\.\d+\.\d+$/
# @TODO remove the following line and uncomment above after deploy testing complete
- /^(test\-devnet\-)*\d+\.\d+\.\d+$/

- build_faucet_and_genesis:
Expand All @@ -682,12 +746,22 @@ workflows:
- /.*/
tags:
only:
# - /^\d+\.\d+\.\d+$/
# @TODO remove the following line and uncomment above after deploy testing complete
- /^(test\-devnet\-)*\d+\.\d+\.\d+$/

- publish_release:
requires:
- build_linux
- build_macos
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^(test\-devnet\-)*\d+\.\d+\.\d+$/

- build_docker_img:
user_devnet: true
test_devnet: true
requires:
- build_linux
- build_faucet_and_genesis
Expand All @@ -697,11 +771,11 @@ workflows:
- /.*/
tags:
only:
# - /^\d+\.\d+\.\d+$/
# @TODO remove the following line and uncomment above after deploy testing complete
- /^(test\-devnet\-)*\d+\.\d+\.\d+$/

- trigger_user_devnet_deploy:
- trigger_devnet_deploy:
test_devnet: true
network: "test"
requires:
- build_docker_img
filters:
Expand All @@ -710,6 +784,4 @@ workflows:
- /.*/
tags:
only:
# - /^\d+\.\d+\.\d+$/
# @TODO remove the following line and uncomment above after deploy testing complete
- /^(test\-devnet\-)*\d+\.\d+\.\d+$/

0 comments on commit 5965fd3

Please sign in to comment.