-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
88 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,5 +15,8 @@ selenium-debug.log | |
*.njsproj | ||
*.sln | ||
|
||
# deploy | ||
deploy_key | ||
|
||
# Add file manually on installation | ||
config/dev.env.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,6 @@ node_js: | |
- '7' | ||
- node | ||
|
||
cache: | ||
directories: | ||
- node_modules | ||
|
||
before_script: | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
|
@@ -24,4 +20,20 @@ script: | |
|
||
env: | ||
global: | ||
secure: uK7Xfbl7b26xVhG0asJn7PXpxaOW07HQqXEPg1DQlKPCJUVmWyRP1fJOIEgn38k25Z4nbfZWs9NgZSkMejobCGjR6k7OPMN+Cs43Dphq3Hlnu94U7SeH+tuZKMUnfjzHqbG2uGsrWF1JZ7jhYOpLdj2+NP60ZHSKIVM4tbixYtBrWADmmlmCES5Bqc4Rddn1n6JklJI21FETq7GNdHYv2ZDb+47ZuPFWIgaUZ7yhfpfqXGPedc5iBH3BoY4kZEioXgTx9Q/2iwGXjI15MbTLsgzJ/b0GOA8IjQ7oAM6CK3uNc1rnjYulIsJVYiyJeuHfDMDamCPRQ3l5G6sMGCNfudZXn4SHFJia6ghP2x13WyqKOQ6RQfljhVRHFMnUpZo9JXlGZkQsEl4HNrrnckZAUXi8PXroSGpiq7X9EjIM5t2RiQrvw2O7qwIgjvBEv4UKd4jCqjsynGAJQkVPVyApuwRZJPBAIdjcowdZxvOj+uPECzRUnfeGpFz3bCd1gu1mMwDjaMlzHw8WSjRPQIXS4q5tp6fnurSs67Lbjmli1qcI20XoQ4m9g0jW8oBkJx8TQgNXObTi8V71UtV9LY8IMfIh/l43FQwaYr1F49raWmO8M0dOP9Uwugtp4hEJnTigj+wh4nRWpPQPvC/pyBoq/xf14Z6ASLf1h9DhIuqLK5g= | ||
- DBUS_SESSION_BUS_ADDRESS=/dev/null | ||
- ENCRYPTION_LABEL: "d18a003013b6" | ||
- COMMIT_AUTHOR_EMAIL: "[email protected]" | ||
- secure: uK7Xfbl7b26xVhG0asJn7PXpxaOW07HQqXEPg1DQlKPCJUVmWyRP1fJOIEgn38k25Z4nbfZWs9NgZSkMejobCGjR6k7OPMN+Cs43Dphq3Hlnu94U7SeH+tuZKMUnfjzHqbG2uGsrWF1JZ7jhYOpLdj2+NP60ZHSKIVM4tbixYtBrWADmmlmCES5Bqc4Rddn1n6JklJI21FETq7GNdHYv2ZDb+47ZuPFWIgaUZ7yhfpfqXGPedc5iBH3BoY4kZEioXgTx9Q/2iwGXjI15MbTLsgzJ/b0GOA8IjQ7oAM6CK3uNc1rnjYulIsJVYiyJeuHfDMDamCPRQ3l5G6sMGCNfudZXn4SHFJia6ghP2x13WyqKOQ6RQfljhVRHFMnUpZo9JXlGZkQsEl4HNrrnckZAUXi8PXroSGpiq7X9EjIM5t2RiQrvw2O7qwIgjvBEv4UKd4jCqjsynGAJQkVPVyApuwRZJPBAIdjcowdZxvOj+uPECzRUnfeGpFz3bCd1gu1mMwDjaMlzHw8WSjRPQIXS4q5tp6fnurSs67Lbjmli1qcI20XoQ4m9g0jW8oBkJx8TQgNXObTi8V71UtV9LY8IMfIh/l43FQwaYr1F49raWmO8M0dOP9Uwugtp4hEJnTigj+wh4nRWpPQPvC/pyBoq/xf14Z6ASLf1h9DhIuqLK5g= | ||
|
||
before_deploy: | ||
- npm run build | ||
|
||
deploy: | ||
skip_cleanup: true | ||
provider: script | ||
script: ./deploy.sh | ||
on: | ||
branch: master | ||
node: '7' | ||
tags: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/bin/bash | ||
set -e # Exit with nonzero exit code if anything fails | ||
|
||
SOURCE_BRANCH="master" | ||
TARGET_BRANCH="master" | ||
|
||
rm -rf dist | ||
|
||
function doCompile { | ||
npm run build | ||
} | ||
|
||
# Pull requests and commits to other branches shouldn't try to deploy. | ||
if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ]; then | ||
echo "Skipping deploy" | ||
exit 0 | ||
fi | ||
|
||
# Save some useful information | ||
REPO="https://github.com/gmalt/gmalt.github.io.git" | ||
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:} | ||
SHA=`git rev-parse --verify HEAD` | ||
|
||
# Clone the existing data branch for this repo into dist/ | ||
# Create a new empty branch if data doesn't exist yet (should only happen on first deply) | ||
git clone $REPO dist | ||
|
||
# Clean out existing contents | ||
rm -rf dist/* || exit 0 | ||
|
||
# Run our compile script | ||
doCompile | ||
|
||
# Now let's go have some fun with the cloned repo | ||
cd dist | ||
git config user.name "Travis CI" | ||
git config user.email "$COMMIT_AUTHOR_EMAIL" | ||
|
||
# Prevent removal of README file | ||
git checkout -- README.md | ||
|
||
# If there are no changes to the compiled out (e.g. this is a README update) then just bail. | ||
git add -N -A | ||
if [[ -z `git diff --exit-code` ]]; then | ||
echo "No changes to the output on this push; exiting." | ||
exit 0 | ||
fi | ||
|
||
# Commit the "changes", i.e. the new version. | ||
# The delta will show diffs between new and old versions. | ||
git add -A | ||
git commit -m "Deploy data: ${SHA}" | ||
|
||
# Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc | ||
cd .. | ||
ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key" | ||
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv" | ||
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR} | ||
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR} | ||
openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in deploy_key.enc -out deploy_key -d | ||
chmod 600 deploy_key | ||
eval `ssh-agent -s` | ||
ssh-add deploy_key | ||
|
||
# Now that we're all set up, we can push. | ||
cd dist | ||
git push $SSH_REPO $TARGET_BRANCH |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDLXKvHxxvk7e3ubd5Y7i0Mg+wIea0OoYDLdZsGGnQNkD8jFCPItHskprp+T8cbkUxxtNsGwymmnovbIr4uj4Cae1fqacvnKWXtpsz+Y+TthBKe1Fa3Rnx9Gv3P+DEI/gW4XuKRh/nJwsCibevzgZLl+mDKZ6YesTFSMl51xJzD3yDZCB367UF2Tv95EEJueSN/O34/Q6B6lfDKsMTjNCbrLDlRD+YzIrGC4v82cDysMUwFkkDBEj99DOYoP7GJ4uLIzeuZTSFjMekxUMJ42qcHD2QQhVbttS9px04HtlcJ9zANv2ued/jbj+cEC4CWWtDlxL5nOcMJJbSSjTT0gCf/V28ZxvrPaEBxG2F1Bf7uH2DDrrMeIgKQqPMTqivjB2T00YfpM6nuH/ufqGTTJzxghLxfGeAMxdQnoMLno98MXVAbgKGCCf17pq4GdPv4nMUa20lySfo17Dvd2IHk6TesucPZxfcwo7xWHWiE7hbicwwQi0ZxuCmMuImnT9fCKzPY6VGgL88gtX7acf2RM6Xv3mlZx3+o4CZr6k3WveZjOg4wZBXtHhLVsHv9aVaKIcHTICQxdoRxB14xoSfGD5NZ7ijfaSGzWDjH897YLdIu/NNjoLhtbSKrTgVW1WA/mgHDJn4D8W0viPQzczz/PvNqZUCtrNpTBIUcLq7+sUTjrQ== [email protected] |