Linux:Travis使用rsync部署:修订间差异
建立內容為「<syntaxhighlight lang="bash"> # cd blog ssh-keygen -t rsa -b 4096 -C 'blog@riguz.com' -f ./deploy_rsa travis encrypt-file deploy_rsa --add ssh-copy-id -i deploy_r…」的新頁面 |
无编辑摘要 |
||
第9行: | 第9行: | ||
travis encrypt-file deploy_rsa --add --com | travis encrypt-file deploy_rsa --add --com | ||
ssh-copy-id -i deploy_rsa.pub blog@riguz.com | ssh-copy-id -i deploy_rsa.pub blog@riguz.com | ||
# on target server | |||
sudo adduser rsync-deploy | |||
sudo usermod -aG www-data rsync-deploy | |||
sudo chown -R rsync-deploy /var/www/html | |||
</syntaxhighlight> | </syntaxhighlight> | ||
2021年8月25日 (三) 15:21的最新版本
# cd blog
ssh-keygen -t rsa -b 4096 -C 'blog@riguz.com' -f ./deploy_rsa
travis encrypt-file deploy_rsa --add
ssh-copy-id -i deploy_rsa.pub blog@riguz.com
gem install travis
travis login --com --github-token <token>
travis encrypt-file deploy_rsa --add --com
ssh-copy-id -i deploy_rsa.pub blog@riguz.com
# on target server
sudo adduser rsync-deploy
sudo usermod -aG www-data rsync-deploy
sudo chown -R rsync-deploy /var/www/html
addons: ssh_known_hosts: 152.32.186.249 before_install: - openssl aes-256-cbc -K $encrypted_db2095f63ba3_key -iv $encrypted_db2095f63ba3_iv -in deploy_rsa.enc -out deploy_rsa -d - openssl aes-256-cbc -K $encrypted_db2095f63ba3_key -iv $encrypted_db2095f63ba3_iv -in deploy_rsa.enc -out ~/.ssh/id_rsa -d - chmod 600 ~/.ssh/id_rsa .... rsync -avz --quiet --delete $TRAVIS_BUILD_DIR/public/ blog@:152.32.186.249/var/www/blog on: