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

ci: deploy package index to esp8266.github.io (#6062)

* ci: deploy package index to esp8266.github.io

* Update deploy_package_index.sh

Fix path for git add
This commit is contained in:
Ivan Grokhotkov 2019-05-10 22:11:33 +08:00 committed by Develo
parent 0ab76fcb37
commit 5b5e56ad43
2 changed files with 17 additions and 20 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
#
# This script updates package index hosted on arduino.esp8266.com.
# This script updates package index hosted on esp8266.github.io (aka arduino.esp8266.com).
# Normally is run by Travis CI for tagged versions, as a deploy step.
tag=`git describe --tags`
@ -10,26 +10,23 @@ 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
openssl aes-256-cbc -K $encrypted_3a94a4db7dec_key -iv $encrypted_3a94a4db7dec_iv -in esp8266_github_io_deploy.enc -out esp8266_github_io_deploy -d
eval "$(ssh-agent -s)"
chmod 600 arduino-esp8266-travis
ssh-add arduino-esp8266-travis
chmod 600 esp8266_github_io_deploy
ssh-add esp8266_github_io_deploy
echo -e "Host github.com\nStrictHostKeyChecking no\n" >> ~/.ssh/config
# 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
# Clone the Github pages repository
git clone git@github.com:esp8266/esp8266.github.io.git
pushd esp8266.github.io
branch=stable
ssh_dl_server=nodeuser@arduino.esp8266.com
base_dir=apps/download_files/download
# Update the package index
cp ../versions/$tag/package_esp8266com_index.json stable/package_esp8266com_index.json
git add stable/package_esp8266com_index.json
# 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"
# Commit and push the changes
git config user.email "travis@travis-ci.org"
git config user.name "Travis CI"
git commit -m "update package index for release $tag"
git push origin master
popd

Binary file not shown.