Skip to content
Permalink
Browse files

Update CI config for beta release prep

Instead of publishing the beta branch, a git tag must be
published to distribute a beta release
  • Loading branch information...
ConnorRigby committed Jul 1, 2019
1 parent f2164e1 commit f3e7a6095f17e92e9084937dd598003386bba22c
Showing with 52 additions and 46 deletions.
  1. +46 −45 .circleci/config.yml
  2. +6 −1 .circleci/fwup_meta_slack.sh
@@ -505,9 +505,7 @@ jobs:
name: Setup ENV
command: |
echo rpi3 > MIX_TARGET_RPI3
cp /nerves/build/farmbot_os/mix.lock.rpi3 MIX_LOCK_RPI3
echo rpi > MIX_TARGET_RPI
cp /nerves/build/farmbot_os/mix.lock.rpi MIX_LOCK_RPI
echo $MIX_ENV > MIX_ENV
- restore_cache:
key: nerves/deploy/system-{{ checksum "MIX_TARGET_RPI3" }}-{{ .Branch }}-{{ .Revision }}-{{ .Environment.CIRCLE_TAG }}
@@ -521,25 +519,25 @@ jobs:
- 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: 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)-beta.fw
fwup -a -t complete -i /nerves/deploy/system/artifacts/farmbot-rpi3-$(cat VERSION)-beta.fw -d /nerves/deploy/system/artifacts/farmbot-rpi3-$(cat VERSION)-beta.img
sha256sum /nerves/deploy/system/artifacts/farmbot-rpi3-$(cat VERSION)-beta.img > /nerves/deploy/system/artifacts/farmbot-rpi3-$(cat VERSION)-beta.sha256
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)-beta.fw
fwup -a -t complete -i /nerves/deploy/system/artifacts/farmbot-rpi-$(cat VERSION)-beta.fw -d /nerves/deploy/system/artifacts/farmbot-rpi-$(cat VERSION)-beta.img
sha256sum /nerves/deploy/system/artifacts/farmbot-rpi-$(cat VERSION)-beta.img > /nerves/deploy/system/artifacts/farmbot-rpi-$(cat VERSION)-beta.sha256
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)-beta" /nerves/deploy/system/artifacts/
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: |
@@ -562,9 +560,7 @@ jobs:
name: Setup ENV
command: |
echo rpi3 > MIX_TARGET_RPI3
cp /nerves/build/farmbot_os/mix.lock.rpi3 MIX_LOCK_RPI3
echo rpi > MIX_TARGET_RPI
cp /nerves/build/farmbot_os/mix.lock.rpi MIX_LOCK_RPI
echo $MIX_ENV > MIX_ENV
- restore_cache:
key: nerves/deploy/system-{{ checksum "MIX_TARGET_RPI3" }}-{{ .Branch }}-{{ .Revision }}-{{ .Environment.CIRCLE_TAG }}
@@ -718,81 +714,86 @@ workflows:
- build_rpi_prod
- build_rpi3_prod

# beta branch to staging.farmbot.io
# any tag containint an `-rcXXX` tag to staging.farmbot.io
nerves_hub_prod_beta_staging:
jobs:
- build_rpi_prod:
context: farmbot-staging
filters:
branches:
only:
- beta
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:
only:
- beta
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

# beta branch to my.farmbot.io
# any tag containint an `-rcXXX` tag to my.farmbot.io
nerves_hub_prod_beta_production:
jobs:
- build_rpi_prod:
context: farmbot-production
filters:
branches:
only:
- beta
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:
only:
- beta
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
requires:
# - build_rpi_prod
- build_rpi3_prod

# staging branch to staging.farmbot.io
nerves_hub_rpi_prod_staging_staging:
jobs:
- build_rpi_prod:
context: farmbot-staging
filters:
branches:
only:
- staging
- build_rpi3_prod:
context: farmbot-staging
filters:
branches:
only:
- staging
- deploy_rpi_prod_staging:
context: farmbot-staging
requires:
- build_rpi_prod
- deploy_rpi3_prod_staging:
context: farmbot-staging
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

# next branch to staging.farmbot.io
@@ -52,9 +52,14 @@ POST_DATA=$(jq -n \
--arg meta_platform "$(grep 'meta-platform' <<< $FW_META | awk -F"=" '{ print $2}')" \
--arg meta_creation_date "$(grep 'meta-creation-date' <<< $FW_META | awk -F"=" '{ print $2}')" \
--arg meta_misc "$(grep 'meta-misc' <<< $FW_META | awk -F"=" '{ print $2}')" \
--arg meta_nerves_hub_deploy $NERVES_HUB_DEPLOY \
--arg slack_channel "C41SHHGQ5" \
'{channel: $slack_channel, as_user: true, blocks: [
{type: "section", block_id: "text1", text: {type: "mrkdwn", text: "*A new FarmBot Firmware is available*"}},
{type: "section", block_id: "text1", text: {type: "mrkdwn", text: "*A new FarmBot Firmware is available*"}},
{type: "context", elements: [
{type: "mrkdwn", text: "*NervesHub Deployment:*"},
{type: "mrkdwn", text: $meta_nerves_hub_deploy}
]},
{type: "context", elements: [
{type: "mrkdwn", text: "*UUID:*"},
{type: "mrkdwn", text: $meta_uuid}

0 comments on commit f3e7a60

Please sign in to comment.
You can’t perform that action at this time.