diff --git a/.travis.yml b/.travis.yml index a1187de..c820627 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,8 +19,8 @@ script: deploy: skip_cleanup: true provider: script - script: scripts/deploy-hex.sh + script: ./scripts/deploy-hex.sh on: tags: true condition: $REBAR_VSN = '3' - erlang: 18.2 + otp_release: 18.2 diff --git a/scripts/deploy-hex.sh b/scripts/deploy-hex.sh index caed276..459fd38 100644 --- a/scripts/deploy-hex.sh +++ b/scripts/deploy-hex.sh @@ -1,15 +1,26 @@ -#!/bin/sh -e +#!/bin/sh -ex +if [[ $TRAVIS_OTP_RELEASE != "18.2" ]]; then + echo Skipping deploy for this OTP release version + exit 0 +fi +echo Create directories mkdir -p ~/.hex mkdir -p ~/.config/rebar3 +echo Decrypt secrets +set +x openssl aes-256-cbc -K $encrypted_fffbebb689b3_key -iv $encrypted_fffbebb689b3_iv -in scripts/hex.config.enc -out ~/.hex/hex.config -d - set -x +echo Create global config echo '{plugins, [rebar3_hex]}.' > ~/.config/rebar3/rebar.config +echo Edit version tag in app.src vi -e -c '%s/{vsn, *.*}/{vsn, "'${TRAVIS_TAG}'"}/g|w|q' src/dogstatsd.app.src +echo Publish to Hex echo 'Y' | ./vendor/rebar hex publish + +echo Done