farmbot_os/.circleci/config.yml

880 lines
30 KiB
YAML

version: 2.0
defaults: &defaults
working_directory: /nerves/build
docker:
- image: nervesproject/nerves_system_br:1.11.3
install_elixir: &install_elixir
run:
name: Install Elixir
command: |
wget https://repo.hex.pm/builds/elixir/v1.9.0-otp-22.zip
unzip -d /usr/local/elixir v1.9.0-otp-22.zip
echo 'export PATH=/usr/local/elixir/bin:$PATH' >> $BASH_ENV
install_hex_archives: &install_hex_archives
run:
name: Install archives
command: |
cd /tmp
mix local.hex --force
mix local.rebar --force
mix archive.install hex nerves_bootstrap "~> 1.6" --force
install_arduino: &install_arduino
run:
name: Run setup script
command: bash .circleci/setup-arduino.sh
install_slack_helpers: &install_slack_helpers
run:
name: Install Slack Helpers
command: |
wget https://gist.githubusercontent.com/ConnorRigby/03e722be4be70f8588f5ed74420e4eaa/raw/28a51d8f52ec7d569e8f7f20b83349816ddf63cf/slack_message.ex
cp .circleci/fwup_meta_slack.sh /usr/bin/
install_ghr: &install_ghr
run:
name: Install ghr (Github Releases)
command: |
wget https://github.com/tcnksm/ghr/releases/download/v0.9.0/ghr_v0.9.0_linux_amd64.tar.gz
tar xf ghr_v0.9.0_linux_amd64.tar.gz
ln -sf ghr_v0.9.0_linux_amd64/ghr .
install_jq: &install_jq
run:
name: Install jq
command: |
wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64
chmod +x ./jq-linux64
mv ./jq-linux64 /usr/bin/jq
install_libnl: &install_libnl
run:
name: Install libnl
command: |
apt-get update
apt-get install pkg-config libnl-genl-3-dev -y
install_mdl: &install_mdl
run:
name: Install libnl
command: |
apt-get update
apt-get install ruby -y
gem install mdl
build_firmware_steps: &build_firmware_steps
steps:
- checkout
- run: git submodule update --init --recursive
- run:
name: Setup ENV
command: |
echo "$MIX_TARGET" > MIX_TARGET
echo "$MIX_ENV" > MIX_ENV
- restore_cache:
key: v14-fbos-{{ checksum "MIX_TARGET" }}-{{ checksum "MIX_ENV" }}-dependency-cache-{{ checksum "farmbot_os/mix.lock" }}
- restore_cache:
key: v14-fbos-host-test-dependency-cache-{{ checksum "farmbot_os/mix.lock" }}
- <<: *install_elixir
- <<: *install_hex_archives
- <<: *install_libnl
- run:
name: Build Farmbot OS Firmware
working_directory: /nerves/build/farmbot_os
command: |
mix deps.get
mix compile --force
mix firmware
- run:
name: Create artifact dir
command: mkdir -p /nerves/deploy/system/artifacts
- run:
name: Create artifacts
command: |
cp /nerves/build/farmbot_os/_build/${MIX_TARGET}/${MIX_TARGET}_${MIX_ENV}/nerves/images/farmbot.fw /nerves/deploy/system/artifacts/farmbot-${MIX_TARGET}-$(cat VERSION).fw
- save_cache:
key: v14-fbos-{{ checksum "MIX_TARGET" }}-{{ checksum "MIX_ENV" }}-dependency-cache-{{ checksum "farmbot_os/mix.lock" }}
paths:
- /nerves/build/farmbot_os/_build/
- /nerves/build/farmbot_os/deps/
- ~/.nerves/
- save_cache:
key: nerves/deploy/system-{{ checksum "MIX_TARGET" }}-{{ .Branch }}-{{ .Revision }}-{{ .Environment.CIRCLE_TAG }}
paths:
- "/nerves/deploy/system"
build_firmware_clean_steps: &build_firmware_clean_steps
steps:
- checkout
- run: git submodule update --init --recursive
- run:
name: Setup ENV
command: |
echo "$MIX_TARGET" > MIX_TARGET
echo "$MIX_ENV" > MIX_ENV
- <<: *install_elixir
- <<: *install_hex_archives
- <<: *install_libnl
- run:
name: Build Farmbot OS Firmware
working_directory: /nerves/build/farmbot_os
command: |
mix deps.get
mix compile --force
mix firmware
- run:
name: Create artifact dir
command: mkdir -p /nerves/deploy/system/artifacts
- run:
name: Create artifacts
command: |
cp /nerves/build/farmbot_os/_build/${MIX_TARGET}/${MIX_TARGET}_${MIX_ENV}/nerves/images/farmbot.fw /nerves/deploy/system/artifacts/farmbot-${MIX_TARGET}-$(cat VERSION).fw
- save_cache:
key: v14-fbos-{{ checksum "MIX_TARGET" }}-{{ checksum "MIX_ENV" }}-dependency-cache-{{ checksum "farmbot_os/mix.lock" }}
paths:
- /nerves/build/farmbot_os/_build/
- /nerves/build/farmbot_os/deps/
- ~/.nerves/
- save_cache:
key: nerves/deploy/system-{{ checksum "MIX_TARGET" }}-{{ .Branch }}-{{ .Revision }}-{{ .Environment.CIRCLE_TAG }}
paths:
- "/nerves/deploy/system"
deploy_nerves_hub_firmware_steps: &deploy_nerves_hub_firmware_steps
steps:
- checkout
- run: git submodule update --init --recursive
- run:
name: Setup ENV
command: |
echo "$MIX_TARGET" > MIX_TARGET
echo "$MIX_ENV" > MIX_ENV
- restore_cache:
key: v14-fbos-{{ checksum "MIX_TARGET" }}-{{ checksum "MIX_ENV" }}-dependency-cache-{{ checksum "farmbot_os/mix.lock" }}
- restore_cache:
key: nerves/deploy/system-{{ checksum "MIX_TARGET" }}-{{ .Branch }}-{{ .Revision }}-{{ .Environment.CIRCLE_TAG }}
- <<: *install_elixir
- <<: *install_hex_archives
- <<: *install_jq
- <<: *install_slack_helpers
- run:
name: Sign Image
working_directory: /nerves/build/farmbot_os
command: |
mix deps.get
mix nerves_hub.firmware sign --key notreal /nerves/deploy/system/artifacts/farmbot-${MIX_TARGET}-$(cat ../VERSION).fw
- run:
name: Publish to NervesHub
working_directory: /nerves/build/farmbot_os
command: mix nerves_hub.firmware publish --deploy ${NERVES_HUB_DEPLOY} ${NERVES_HUB_TTL} /nerves/deploy/system/artifacts/farmbot-${MIX_TARGET}-$(cat ../VERSION).fw
- run:
name: Send Slack Message
command: ./.circleci/fwup_meta_slack.sh -i /nerves/deploy/system/artifacts/farmbot-${MIX_TARGET}-$(cat VERSION).fw
jobs:
################################################################################
# TEST #
################################################################################
test_farmbot_celery_script:
<<: *defaults
environment:
MIX_ENV: test
MIX_TARGET: host
NERVES_LOG_DISABLE_PROGRESS_BAR: "yes"
ELIXIR_VERSION: 1.8.0
steps:
- checkout
- restore_cache:
keys:
- v14-fbcs-test-dependency-cache-{{ checksum "farmbot_celery_script/mix.lock" }}
- <<: *install_elixir
- <<: *install_hex_archives
- run:
name: Test Farmbot CeleryScript
working_directory: /nerves/build/farmbot_celery_script
command: |
mix deps.get
mix compile
mix format --check-formatted
mix coveralls.json
bash <(curl -s https://codecov.io/bash)
- save_cache:
key: v14-fbcs-test-dependency-cache-{{ checksum "farmbot_celery_script/mix.lock" }}
paths:
- farmbot_celery_script/_build/test
- farmbot_celery_script/deps
- save_cache:
key: v14-fbcs-coverage-cache-{{ .Branch }}-{{ .Revision }}
paths:
- farmbot_celery_script/cover
- store_artifacts:
path: farmbot_celery_script/cover
test_farmbot_firmware:
<<: *defaults
environment:
MIX_ENV: test
MIX_TARGET: host
NERVES_LOG_DISABLE_PROGRESS_BAR: "yes"
ELIXIR_VERSION: 1.8.0
steps:
- checkout
- restore_cache:
keys:
- v14-fbfw-test-dependency-cache-{{ checksum "farmbot_firmware/mix.lock" }}
- <<: *install_elixir
- <<: *install_hex_archives
- run:
name: Test Farmbot Firmware
working_directory: /nerves/build/farmbot_firmware
command: |
mix deps.get
mix compile
mix format --check-formatted
mix coveralls.json
bash <(curl -s https://codecov.io/bash)
- save_cache:
key: v14-fbfw-test-dependency-cache-{{ checksum "farmbot_firmware/mix.lock" }}
paths:
- farmbot_firmware/_build/test
- farmbot_firmware/deps
- save_cache:
key: v14-fbfw-coverage-cache-{{ .Branch }}-{{ .Revision }}
paths:
- farmbot_firmware/cover
- store_artifacts:
path: farmbot_firmware/cover
test_farmbot_core:
<<: *defaults
environment:
MIX_ENV: test
MIX_TARGET: host
NERVES_LOG_DISABLE_PROGRESS_BAR: "yes"
ELIXIR_VERSION: 1.8.0
TZ: "America/Los_Angeles"
steps:
- checkout
- run: git submodule update --init --recursive
- restore_cache:
keys:
- v14-fbcore-test-dependency-cache-{{ checksum "farmbot_core/mix.lock" }}
- restore_cache:
keys:
- v14-fbcore-test-arduino-dependency-cache-{{ checksum ".circleci/setup-arduino.sh" }}
- <<: *install_elixir
- <<: *install_hex_archives
- <<: *install_arduino
- run:
name: Ensure format
command: |
mix format --check-formatted
- run:
name: Test Farmbot Core
working_directory: /nerves/build/farmbot_core
command: |
mix deps.get
mix compile
mix format --check-formatted
mix coveralls.json --trace
bash <(curl -s https://codecov.io/bash)
- save_cache:
key: v14-fbcore-test-dependency-cache-{{ checksum "farmbot_core/mix.lock" }}
paths:
- farmbot_core/_build/test
- farmbot_core/deps
- farmbot_core/arduino
- save_cache:
key: v14-fbcore-coverage-cache-{{ .Branch }}-{{ .Revision }}
paths:
- farmbot_core/cover
- store_artifacts:
path: farmbot_core/cover
- save_cache:
key: v14-fbcore-test-arduino-dependency-cache-{{ checksum ".circleci/setup-arduino.sh" }}
paths:
- ~/arduino-1.8.5
- farmbot_core/_build/core
- farmbot_core/_build/libraries
- farmbot_core/_build/farmduino_k14
- farmbot_core/_build/farmduino_v10
- farmbot_core/_build/ramps_v14
test_farmbot_ext:
<<: *defaults
environment:
MIX_ENV: test
MIX_TARGET: host
NERVES_LOG_DISABLE_PROGRESS_BAR: "yes"
ELIXIR_VERSION: 1.8.0
SKIP_ARDUINO_BUILD: 1
steps:
- checkout
- run: git submodule update --init --recursive
- restore_cache:
keys:
- v14-fbext-test-dependency-cache-{{ checksum "farmbot_ext/mix.lock" }}
- <<: *install_elixir
- <<: *install_hex_archives
- run:
name: Test Farmbot Ext
working_directory: /nerves/build/farmbot_ext
command: |
mix deps.get
mix compile
mix format --check-formatted
mix ecto.create
mix ecto.migrate
mix coveralls.json
bash <(curl -s https://codecov.io/bash)
- save_cache:
key: v14-fbext-test-dependency-cache-{{ checksum "farmbot_ext/mix.lock" }}
paths:
- farmbot_ext/_build/test
- farmbot_ext/deps
- save_cache:
key: v14-fbext-coverage-cache-{{ .Branch }}-{{ .Revision }}
paths:
- farmbot_ext/cover
- store_artifacts:
path: farmbot_ext/cover
test_farmbot_os:
<<: *defaults
environment:
MIX_ENV: test
MIX_TARGET: host
NERVES_LOG_DISABLE_PROGRESS_BAR: "yes"
ELIXIR_VERSION: 1.8.0
steps:
- checkout
- run: git submodule update --init --recursive
- restore_cache:
keys:
- v14-fbos-host-test-dependency-cache-{{ checksum "farmbot_os/mix.lock" }}
- <<: *install_elixir
- <<: *install_hex_archives
- run:
name: Test Farmbot OS
working_directory: /nerves/build/farmbot_os
command: |
mix deps.get
mix compile
mix format --check-formatted
mix coveralls.json
bash <(curl -s https://codecov.io/bash)
- save_cache:
key: v14-fbos-host-test-dependency-cache-{{ checksum "farmbot_os/mix.lock" }}
paths:
- farmbot_os/_build/host
- farmbot_os/deps/host
- save_cache:
key: v14-fbos-coverage-cache-{{ .Branch }}-{{ .Revision }}
paths:
- farmbot_os/cover
- store_artifacts:
path: farmbot_os/cover
################################################################################
# target=rpi app_env=prod #
################################################################################
build_rpi_prod:
<<: *defaults
environment:
MIX_TARGET: rpi
MIX_ENV: prod
<<: *build_firmware_steps
################################################################################
# target=rpi3 app_env=prod #
################################################################################
build_rpi3_prod:
<<: *defaults
environment:
MIX_TARGET: rpi3
MIX_ENV: prod
<<: *build_firmware_steps
################################################################################
# target=rpi app_env=prod #
################################################################################
build_clean_rpi_prod:
<<: *defaults
environment:
MIX_TARGET: rpi
MIX_ENV: prod
<<: *build_firmware_clean_steps
################################################################################
# target=rpi3 app_env=prod #
################################################################################
build_clean_rpi3_prod:
<<: *defaults
environment:
MIX_TARGET: rpi3
MIX_ENV: prod
<<: *build_firmware_clean_steps
################################################################################
# target=rpi app_env=prod channel=stable #
################################################################################
deploy_rpi_prod_stable:
<<: *defaults
environment:
MIX_TARGET: rpi
MIX_ENV: prod
NERVES_HUB_DEPLOY: rpi-prod-stable
<<: *deploy_nerves_hub_firmware_steps
################################################################################
# target=rpi3 app_env=prod channel=stable #
################################################################################
deploy_rpi3_prod_stable:
<<: *defaults
environment:
MIX_TARGET: rpi3
MIX_ENV: prod
NERVES_HUB_DEPLOY: rpi3-prod-stable
<<: *deploy_nerves_hub_firmware_steps
################################################################################
# target=rpi app_env=prod channel=beta #
################################################################################
deploy_rpi_prod_beta:
<<: *defaults
environment:
MIX_TARGET: rpi
MIX_ENV: prod
NERVES_HUB_DEPLOY: rpi-prod-beta
NERVES_HUB_TTL: "--ttl 3600"
<<: *deploy_nerves_hub_firmware_steps
################################################################################
# target=rpi3 app_env=prod channel=beta #
################################################################################
deploy_rpi3_prod_beta:
<<: *defaults
environment:
MIX_TARGET: rpi3
MIX_ENV: prod
NERVES_HUB_DEPLOY: rpi3-prod-beta
NERVES_HUB_TTL: "--ttl 3600"
<<: *deploy_nerves_hub_firmware_steps
################################################################################
# target=rpi3 app_env=prod channel=staging #
################################################################################
deploy_rpi3_prod_staging:
<<: *defaults
environment:
MIX_TARGET: rpi3
MIX_ENV: prod
NERVES_HUB_DEPLOY: rpi3-prod-staging
NERVES_HUB_TTL: "--ttl 900"
<<: *deploy_nerves_hub_firmware_steps
################################################################################
# target=rpi3 app_env=prod channel=qa #
################################################################################
deploy_rpi3_prod_qa:
<<: *defaults
environment:
MIX_TARGET: rpi3
MIX_ENV: prod
NERVES_HUB_DEPLOY: rpi3-prod-qa
NERVES_HUB_TTL: "--ttl 900"
<<: *deploy_nerves_hub_firmware_steps
################################################################################
# target=rpi app_env=prod channel=qa #
################################################################################
deploy_rpi_prod_qa:
<<: *defaults
environment:
MIX_TARGET: rpi
MIX_ENV: prod
NERVES_HUB_DEPLOY: rpi-prod-qa
NERVES_HUB_TTL: "--ttl 900"
<<: *deploy_nerves_hub_firmware_steps
################################################################################
# TARGET FIRMWARE NERVES GITHUB RELEASE BETA #
################################################################################
publish_prod_firmware_beta_release:
<<: *defaults
environment:
MIX_ENV: prod
ELIXIR_VERSION: 1.8.0
steps:
- checkout
- run:
name: Setup ENV
command: |
echo rpi3 > MIX_TARGET_RPI3
echo rpi > MIX_TARGET_RPI
echo $MIX_ENV > MIX_ENV
- restore_cache:
key: nerves/deploy/system-{{ checksum "MIX_TARGET_RPI3" }}-{{ .Branch }}-{{ .Revision }}-{{ .Environment.CIRCLE_TAG }}
- restore_cache:
key: nerves/deploy/system-{{ checksum "MIX_TARGET_RPI" }}-{{ .Branch }}-{{ .Revision }}-{{ .Environment.CIRCLE_TAG }}
- <<: *install_elixir
- <<: *install_hex_archives
- <<: *install_ghr
- <<: *install_slack_helpers
- <<: *install_jq
- add_ssh_keys:
fingerprints:
- "97:92:32:5d:d7:96:e1:fa:f3:6b:f3:bd:d6:aa:84:c6"
- run: grep -Pazo "(?s)(?<=# $(cat VERSION | cut -f1 -d"-"))[^#]+" CHANGELOG.md > RELEASE_NOTES
- run: echo $FWUP_KEY_BASE64 | base64 --decode --ignore-garbage > $NERVES_FW_PRIV_KEY
- run:
name: Sign rpi3 Firmware
command: |
mv /nerves/deploy/system/artifacts/farmbot-rpi3-$(cat VERSION).fw /tmp/farmbot-rpi3-$(cat VERSION).fw
fwup -S -s $NERVES_FW_PRIV_KEY -i /tmp/farmbot-rpi3-$(cat VERSION).fw -o /nerves/deploy/system/artifacts/farmbot-rpi3-$(cat VERSION).fw
fwup -a -t complete -i /nerves/deploy/system/artifacts/farmbot-rpi3-$(cat VERSION).fw -d /nerves/deploy/system/artifacts/farmbot-rpi3-$(cat VERSION).img
sha256sum /nerves/deploy/system/artifacts/farmbot-rpi3-$(cat VERSION).img > /nerves/deploy/system/artifacts/farmbot-rpi3-$(cat VERSION).sha256
- run:
name: Sign rpi Firmware
command: |
mv /nerves/deploy/system/artifacts/farmbot-rpi-$(cat VERSION).fw /tmp/farmbot-rpi-$(cat VERSION).fw
fwup -S -s $NERVES_FW_PRIV_KEY -i /tmp/farmbot-rpi-$(cat VERSION).fw -o /nerves/deploy/system/artifacts/farmbot-rpi-$(cat VERSION).fw
fwup -a -t complete -i /nerves/deploy/system/artifacts/farmbot-rpi-$(cat VERSION).fw -d /nerves/deploy/system/artifacts/farmbot-rpi-$(cat VERSION).img
sha256sum /nerves/deploy/system/artifacts/farmbot-rpi-$(cat VERSION).img > /nerves/deploy/system/artifacts/farmbot-rpi-$(cat VERSION).sha256
- run:
name: Publish Github Release
command: ./ghr -t $GITHUB_TOKEN -u farmbot -r farmbot_os -prerelease -recreate -prerelease -b "$(cat RELEASE_NOTES)" -c $(git rev-parse --verify HEAD) "v$(cat VERSION)" /nerves/deploy/system/artifacts/
- run:
name: Slack message
command: |
export OTA_URL=$(wget https://api.github.com/repos/farmbot/farmbot_os/releases -qO- | jq '.[0].url' | sed -e 's/^"//' -e 's/"$//')
export SLACK_MESSAGE="New Farmbot Beta: $OTA_URL"
elixir slack_message.ex $SLACK_MESSAGE
################################################################################
# TARGET FIRMWARE NERVES GITHUB RELEASE MASTER #
################################################################################
publish_prod_firmware_master_release:
<<: *defaults
environment:
MIX_ENV: prod
ELIXIR_VERSION: 1.8.0
steps:
- checkout
- run:
name: Setup ENV
command: |
echo rpi3 > MIX_TARGET_RPI3
echo rpi > MIX_TARGET_RPI
echo $MIX_ENV > MIX_ENV
- restore_cache:
key: nerves/deploy/system-{{ checksum "MIX_TARGET_RPI3" }}-{{ .Branch }}-{{ .Revision }}-{{ .Environment.CIRCLE_TAG }}
- restore_cache:
key: nerves/deploy/system-{{ checksum "MIX_TARGET_RPI" }}-{{ .Branch }}-{{ .Revision }}-{{ .Environment.CIRCLE_TAG }}
- <<: *install_elixir
- <<: *install_hex_archives
- <<: *install_ghr
- <<: *install_slack_helpers
- add_ssh_keys:
fingerprints:
- "97:92:32:5d:d7:96:e1:fa:f3:6b:f3:bd:d6:aa:84:c6"
- run: grep -Pazo "(?s)(?<=# $(cat VERSION))[^#]+" CHANGELOG.md > RELEASE_NOTES
- run: echo $FWUP_KEY_BASE64 | base64 --decode --ignore-garbage > $NERVES_FW_PRIV_KEY
- run:
name: Sign rpi3 Firmware and create image
command: |
mv /nerves/deploy/system/artifacts/farmbot-rpi3-$(cat VERSION).fw /tmp/farmbot-rpi3-$(cat VERSION).fw
fwup -S -s $NERVES_FW_PRIV_KEY -i /tmp/farmbot-rpi3-$(cat VERSION).fw -o /nerves/deploy/system/artifacts/farmbot-rpi3-$(cat VERSION).fw
fwup -a -t complete -i /nerves/deploy/system/artifacts/farmbot-rpi3-$(cat VERSION).fw -d /nerves/deploy/system/artifacts/farmbot-rpi3-$(cat VERSION).img
sha256sum /nerves/deploy/system/artifacts/farmbot-rpi3-$(cat VERSION).img > /nerves/deploy/system/artifacts/farmbot-rpi3-$(cat VERSION).sha256
- run:
name: Sign rpi Firmware and create image
command: |
mv /nerves/deploy/system/artifacts/farmbot-rpi-$(cat VERSION).fw /tmp/farmbot-rpi-$(cat VERSION).fw
fwup -S -s $NERVES_FW_PRIV_KEY -i /tmp/farmbot-rpi-$(cat VERSION).fw -o /nerves/deploy/system/artifacts/farmbot-rpi-$(cat VERSION).fw
fwup -a -t complete -i /nerves/deploy/system/artifacts/farmbot-rpi-$(cat VERSION).fw -d /nerves/deploy/system/artifacts/farmbot-rpi-$(cat VERSION).img
sha256sum /nerves/deploy/system/artifacts/farmbot-rpi-$(cat VERSION).img > /nerves/deploy/system/artifacts/farmbot-rpi-$(cat VERSION).sha256
- run:
name: Publish Github Release
command: ./ghr -t $GITHUB_TOKEN -u farmbot -r farmbot_os -recreate -prerelease -draft -delete -b "$(cat RELEASE_NOTES)" -c $(git rev-parse --verify HEAD) "v$(cat VERSION)" /nerves/deploy/system/artifacts
- run:
name: Send Slack Message
command: elixir slack_message.ex "New Farmbot Prod release $(cat VERSION)"
workflows:
version: 2
test:
jobs:
- test_farmbot_celery_script:
context: org-global
filters:
branches:
ignore:
- master
- staging
- beta
- next
- /^qa\/.*/
- test_farmbot_firmware:
context: org-global
filters:
branches:
ignore:
- master
- staging
- beta
- next
- /^qa\/.*/
- test_farmbot_core:
context: org-global
filters:
branches:
ignore:
- master
- staging
- beta
- next
- /^qa\/.*/
- test_farmbot_ext:
context: org-global
filters:
branches:
ignore:
- master
- staging
- beta
- next
- /^qa\/.*/
- test_farmbot_os:
context: org-global
filters:
branches:
ignore:
- master
- staging
- beta
- next
- /^qa\/.*/
# master branch to staging.farmbot.io
nerves_hub_prod_stable_staging:
jobs:
- build_clean_rpi_prod:
context: farmbot-staging
filters:
branches:
only:
- master
- build_clean_rpi3_prod:
context: farmbot-staging
filters:
branches:
only:
- master
- deploy_rpi_prod_stable:
context: farmbot-staging
requires:
- build_clean_rpi_prod
- deploy_rpi3_prod_stable:
context: farmbot-staging
requires:
- build_clean_rpi3_prod
# master branch to my.farmbot.io
nerves_hub_prod_stable_production:
jobs:
- build_clean_rpi_prod:
context: farmbot-production
filters:
branches:
only:
- master
- build_clean_rpi3_prod:
context: farmbot-production
filters:
branches:
only:
- master
- deploy_rpi_prod_stable:
context: farmbot-production
requires:
- build_clean_rpi_prod
- deploy_rpi3_prod_stable:
context: farmbot-production
requires:
- build_clean_rpi3_prod
- publish_prod_firmware_master_release:
context: org-global
requires:
- build_clean_rpi_prod
- build_clean_rpi3_prod
# any tag containint an `-rcXXX` tag to staging.farmbot.io
nerves_hub_prod_beta_staging:
jobs:
- build_rpi_prod:
context: farmbot-staging
filters:
branches:
ignore: /.*/
tags:
only: /v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)-rc(0|[1-9]\d*)+?/
- build_rpi3_prod:
context: farmbot-staging
filters:
branches:
ignore: /.*/
tags:
only: /v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)-rc(0|[1-9]\d*)+?/
- deploy_rpi_prod_beta:
context: farmbot-staging
filters:
branches:
ignore: /.*/
tags:
only: /v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)-rc(0|[1-9]\d*)+?/
requires:
- build_rpi_prod
- deploy_rpi3_prod_beta:
context: farmbot-staging
filters:
branches:
ignore: /.*/
tags:
only: /v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)-rc(0|[1-9]\d*)+?/
requires:
- build_rpi3_prod
# any tag containint an `-rcXXX` tag to my.farmbot.io
nerves_hub_prod_beta_production:
jobs:
- build_rpi_prod:
context: farmbot-production
filters:
branches:
ignore: /.*/
tags:
only: /v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)-rc(0|[1-9]\d*)+?/
- build_rpi3_prod:
context: farmbot-production
filters:
branches:
ignore: /.*/
tags:
only: /v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)-rc(0|[1-9]\d*)+?/
- deploy_rpi_prod_beta:
context: farmbot-production
filters:
branches:
ignore: /.*/
tags:
only: /v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)-rc(0|[1-9]\d*)+?/
requires:
- build_rpi_prod
- deploy_rpi3_prod_beta:
context: farmbot-production
filters:
branches:
ignore: /.*/
tags:
only: /v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)-rc(0|[1-9]\d*)+?/
requires:
- build_rpi3_prod
- publish_prod_firmware_beta_release:
context: org-global
filters:
branches:
ignore: /.*/
tags:
only: /v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)-rc(0|[1-9]\d*)+?/
requires:
# - build_rpi_prod
- build_rpi3_prod
# any branch matching qa/** to staging.farmbot.io
nerves_hub_prod_staging_staging:
jobs:
- build_rpi3_prod:
context: farmbot-staging
filters:
branches:
only:
- /^qa\/.*/
- build_rpi_prod:
context: farmbot-staging
filters:
branches:
only:
- /^qa\/.*/
- deploy_rpi3_prod_qa:
context: farmbot-staging
filters:
branches:
only:
- /^qa\/.*/
requires:
- build_rpi3_prod
- deploy_rpi_prod_qa:
context: farmbot-staging
filters:
branches:
only:
- /^qa\/.*/
requires:
- build_rpi_prod
# any branch matching qa/** to production.farmbot.io
nerves_hub_prod_staging_production:
jobs:
- build_rpi3_prod:
context: farmbot-production
filters:
branches:
only:
- /^qa\/.*/
- build_rpi_prod:
context: farmbot-production
filters:
branches:
only:
- /^qa\/.*/
- deploy_rpi3_prod_qa:
context: farmbot-production
filters:
branches:
only:
- /^qa\/.*/
requires:
- build_rpi3_prod
- deploy_rpi_prod_qa:
context: farmbot-production
filters:
branches:
only:
- /^qa\/.*/
requires:
- build_rpi_prod