This article is a follow up of Continuous Deployment with Gitlab, Gitlab-CI and CleverCloud, you might want to read it first!
Nearly 1 year past, clever-tools is now a single binary (along with a native node extension) packaged by pkg, we can easily improve our CI/CD workflow now! Instead of :
deploy:clevercloud:
image: node:6-wheezy
stage: deploy
only:
- /master/
script:
- git remote add clever https://$CLEVER_TOKEN:$CLEVER_SECRET@push-par-clevercloud-customers.services.clever-cloud.com/app_YOUR_APPLICATION_ID.git
- git push --verbose --force clever master 2>&1 | grep -e 'remote:' -e '->'
my .gitlab-ci.yml now contains
deploy:clevercloud:
image: ubuntu
stage: deploy
only:
- /master/
script:
- apt-get update && apt-get install -y curl
- curl https://clever-tools.cellar.services.clever-cloud.com/releases/latest/clever-tools-latest_linux.tar.gz > clever-tools-latest_linux.tar.gz
- tar -xvf clever-tools-latest_linux.tar.gz
- ./clever login --token $CLEVER_TOKEN --secret $CLEVER_SECRET
- rm -f .clever.json
- ./clever link -a deploy $APP_ID
- ./clever deploy -a deploy
Now my deploy job displays CleverCloud deployment logs, awesome right?