From 5b5e56ad43b8b856ab25018fc8203fb7a653ec10 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Fri, 10 May 2019 22:11:33 +0800 Subject: [PATCH] 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 --- package/deploy_package_index.sh | 37 ++++++++++++--------------- package/esp8266_github_io_deploy.enc | Bin 0 -> 432 bytes 2 files changed, 17 insertions(+), 20 deletions(-) create mode 100644 package/esp8266_github_io_deploy.enc diff --git a/package/deploy_package_index.sh b/package/deploy_package_index.sh index a22996b9c..f8b5cedff 100644 --- a/package/deploy_package_index.sh +++ b/package/deploy_package_index.sh @@ -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 diff --git a/package/esp8266_github_io_deploy.enc b/package/esp8266_github_io_deploy.enc new file mode 100644 index 0000000000000000000000000000000000000000..b9eed57cc6c7f1820fd26c127585c468d0e444e1 GIT binary patch literal 432 zcmV;h0Z;x|!oZim#`hG0J@flq^9Q3y?Oig(dwZ0v1@zT}UacaIL-_Vq{e%7eoQ&39 z_P~A;w?m909toET0oGo11kvW~_luiG2oG(3M8F58jX$WX$P$i(aXquUkk2D7~xJXw}E ziE%m&mL8Gr z;#A!D6yl|F>KK^_k>nZGk4pHwBGn>4YdWh>jmHXI^GF@ z_|Xm#4j%a=t1kHI`St09J)u