From a2bf31295090acdc0d3aa568787e77e8718e8ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20Mari=C8=99?= Date: Mon, 28 Mar 2016 02:46:09 +0300 Subject: [PATCH] Remove SSH set up related code Remove the code added in order to set up the SSH connection, and instead, use travis-scripts' helper function `set-up-ssh`. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Ref: https://github.com/alrra/travis-scripts/issues/19 --- .travis.yml | 14 ++++++-- .../travis => .travis}/github_deploy_key.enc | Bin package.json | 2 +- scripts/travis/auto_update_dist.sh | 30 ------------------ 4 files changed, 13 insertions(+), 33 deletions(-) rename {scripts/travis => .travis}/github_deploy_key.enc (100%) delete mode 100755 scripts/travis/auto_update_dist.sh diff --git a/.travis.yml b/.travis.yml index 667746f4..9b51bde7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,19 @@ # For more information about the configurations used # in this file, please see the Travis CI documentation: -# http://docs.travis-ci.com +# https://docs.travis-ci.com after_success: - - ./scripts/travis/auto_update_dist.sh + - | + + # Automatically update the content from the `dist/` directory + + $(npm bin)/travis-after-all \ + && $(npm bin)/set-up-ssh -k "$encrypted_7289798db853_key" \ + -iv "$encrypted_7289798db853_iv" \ + --path-encrypted-key ".travis/github_deploy_key.enc" \ + && $(npm bin)/commit-changes --branch "master" \ + --commands "npm run build" \ + --commit-message "Update content from the \`dist\` directory [skip ci]" env: global: diff --git a/scripts/travis/github_deploy_key.enc b/.travis/github_deploy_key.enc similarity index 100% rename from scripts/travis/github_deploy_key.enc rename to .travis/github_deploy_key.enc diff --git a/package.json b/package.json index afbbded0..52eec562 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ ] }, "devDependencies": { - "@alrra/travis-scripts": "^2.0.0", + "@alrra/travis-scripts": "^2.1.0", "apache-server-configs": "2.14.0", "archiver": "^0.21.0", "babel-core": "^6.7.2", diff --git a/scripts/travis/auto_update_dist.sh b/scripts/travis/auto_update_dist.sh deleted file mode 100755 index a396fe67..00000000 --- a/scripts/travis/auto_update_dist.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -declare -r PRIVATE_KEY_FILE_NAME='github_deploy_key' - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Decrypt the file containing the private key - -openssl aes-256-cbc \ - -K $encrypted_7289798db853_key \ - -iv $encrypted_7289798db853_iv \ - -in "$(dirname "$BASH_SOURCE")/${PRIVATE_KEY_FILE_NAME}.enc" \ - -out ~/.ssh/$PRIVATE_KEY_FILE_NAME -d - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Enable SSH authentication - -chmod 600 ~/.ssh/$PRIVATE_KEY_FILE_NAME -echo "Host github.com" >> ~/.ssh/config -echo " IdentityFile ~/.ssh/$PRIVATE_KEY_FILE_NAME" >> ~/.ssh/config - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Automatically update the content from the `dist/` directory - -$(npm bin)/travis-after-all && \ - $(npm bin)/commit-changes --branch "master" \ - --commands "npm run build" \ - --commit-message "Update content from the \`dist\` directory [skip ci]"