diff --git a/.travis.yml b/.travis.yml index 0cfba22a2..03c6caf3f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,19 +44,28 @@ script: - $TRAVIS_BUILD_DIR/tests/common.sh deploy: - provider: releases - prerelease: true - skip_cleanup: true - api_key: - secure: A4FBmqyhlzy33oPeZVolg2Q/A3ZcJ3WnRQqQJ3NAPy+qGM5xcboOYtwcLL9vKaHZGfUB7lUP9QVZFGou1Wrmo9DnPvAoe3+XvCaDRGzVMxeIpu7UStbBD4Knbh98tlbMvZCXYRlT4VcusI9bMLK6UWw4sMdPislBh2FEfglTiag= - file_glob: true - file: - - package/versions/$TRAVIS_TAG/esp8266-$TRAVIS_TAG.zip - - package/versions/$TRAVIS_TAG/package_esp8266com_index.json - on: - repo: esp8266/Arduino - tags: true - condition: "$BUILD_TYPE = package" + - provider: releases + draft: true + skip_cleanup: true + api_key: + secure: A4FBmqyhlzy33oPeZVolg2Q/A3ZcJ3WnRQqQJ3NAPy+qGM5xcboOYtwcLL9vKaHZGfUB7lUP9QVZFGou1Wrmo9DnPvAoe3+XvCaDRGzVMxeIpu7UStbBD4Knbh98tlbMvZCXYRlT4VcusI9bMLK6UWw4sMdPislBh2FEfglTiag= + file_glob: true + file: + - package/versions/$TRAVIS_TAG/esp8266-$TRAVIS_TAG.zip + - package/versions/$TRAVIS_TAG/package_esp8266com_index.json + on: + repo: esp8266/Arduino + tags: true + condition: "$BUILD_TYPE = package" + + - provider: script + skip_cleanup: true + script: bash package/deploy_package_index.sh + on: + repo: esp8266/Arduino + tags: true + condition: "$BUILD_TYPE = package" + notifications: email: diff --git a/package/arduino-esp8266-travis.enc b/package/arduino-esp8266-travis.enc new file mode 100644 index 000000000..66cb5e176 Binary files /dev/null and b/package/arduino-esp8266-travis.enc differ diff --git a/package/deploy_package_index.sh b/package/deploy_package_index.sh new file mode 100644 index 000000000..a22996b9c --- /dev/null +++ b/package/deploy_package_index.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# This script updates package index hosted on arduino.esp8266.com. +# Normally is run by Travis CI for tagged versions, as a deploy step. + +tag=`git describe --tags` + +cd $(dirname "$0") + +# Decrypt and install SSH private key. +# "encrypted_xxx_key" and "encrypted_xxx_iv" are environment variables +# known to Travis CI builds. +openssl aes-256-cbc -K $encrypted_3f14690ceb9b_key -iv $encrypted_3f14690ceb9b_iv -in arduino-esp8266-travis.enc -out arduino-esp8266-travis -d +eval "$(ssh-agent -s)" +chmod 600 arduino-esp8266-travis +ssh-add arduino-esp8266-travis + +# Set SSH server public key +echo "arduino.esp8266.com,104.131.82.128 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBAvoxsdf1jJ1XX7RrCtAQyjvZ3b33bWYfB/XDvEMLtxnJhZr+P/wa7yuZ+UJJ1wuJc+wcIMBNZ2Zz/MbdRMey7A=" \ + >> $HOME/.ssh/known_hosts + +branch=stable +ssh_dl_server=nodeuser@arduino.esp8266.com +base_dir=apps/download_files/download + +# Upload package_esp8266com_index.json +ssh $ssh_dl_server "mkdir -p $base_dir/versions/$tag" +scp versions/$tag/package_esp8266com_index.json $ssh_dl_server:$base_dir/versions/$tag/ + +# Change symlink for stable version +oldver=$(ssh $ssh_dl_server "readlink $base_dir/$branch") +newver="versions/$tag" +echo "Changing version of $branch from $oldver to $newver" + +ssh $ssh_dl_server "pushd apps/download_files/download && ln -snf versions/$tag $branch"