1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

ci: deploy released package index to arduino.esp8266.com

This commit is contained in:
Ivan Grokhotkov 2018-08-02 16:12:03 +03:00 committed by Ivan Grokhotkov
parent e4d9c279ef
commit 0f762f64af
3 changed files with 57 additions and 13 deletions

View File

@ -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:

Binary file not shown.

View File

@ -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"