Add some heroku stuff

pull/396/head
connor rigby 2018-01-04 09:18:46 -08:00
parent 4ddba4e087
commit 88a98a1480
2 changed files with 29 additions and 0 deletions

View File

@ -126,17 +126,30 @@ jobs:
<<: *defaults
steps:
- checkout
- run:
name: Run setup script
command: bash .circleci/setup-heroku.sh
- add_ssh_keys:
fingerprints:
- "97:92:32:5d:d7:96:e1:fa:f3:6b:f3:bd:d6:aa:84:c6"
- run:
name: Install dependencies
command: |
wget https://github.com/tcnksm/ghr/releases/download/v0.5.4/ghr_v0.5.4_linux_amd64.zip
unzip ghr_v0.5.4_linux_amd64.zip
apt-get install jq -y
- run:
command: grep -Pazo "(?s)(?<=# $(cat VERSION))[^#]+" CHANGELOG.md > RELEASE_NOTES
- restore_cache:
key: v3-firmware-{{ .Revision }}-{{ .Environment.CIRCLE_TAG }}
- run:
command: ./ghr -t $GITHUB_TOKEN -u farmbot -r farmbot_os -recreate -prerelease -b "$(cat RELEASE_NOTES)" -c $(git rev-parse --verify HEAD) "v$(cat VERSION)-beta" $PWD/artifacts
-run:
name: Update heroku env
command: |
export OTA_URL=$(curl -sS https://api.github.com/repos/farmbot/farmbot_os/releases | jq '.[0].url')
heroku env:set BETA_OTA_URL=$OTA_URL --app=farmbot-production
heroku env:set BETA_OTA_URL=$OTA_URL --app=farmbot-staging
workflows:
version: 2

View File

@ -0,0 +1,16 @@
#!/bin/bash
wget https://cli-assets.heroku.com/branches/stable/heroku-linux-amd64.tar.gz
mkdir -p /usr/local/lib /usr/local/bin
tar -xvzf heroku-linux-amd64.tar.gz -C /usr/local/lib
ln -s /usr/local/lib/heroku/bin/heroku /usr/local/bin/heroku
cat > ~/.netrc << EOF
machine api.heroku.com
login $HEROKU_LOGIN
password $HEROKU_API_KEY
EOF
cat >> ~/.ssh/config << EOF
VerifyHostKeyDNS yes
StrictHostKeyChecking no
EOF