-
Notifications
You must be signed in to change notification settings - Fork 722
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #327 from sroze/automate_travis
setup bower
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 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 |
---|---|---|
|
@@ -3,9 +3,14 @@ language: node_js | |
node_js: 6 | ||
before_install: | ||
- "sh -e /etc/init.d/xvfb start" | ||
env: | ||
global: | ||
- ENCRYPTION_LABEL: 61bce606080b | ||
- COMMIT_AUTHOR_EMAIL: '[email protected]' | ||
before_script: | ||
- "export DISPLAY=:99.0" | ||
- until xwininfo -root > /dev/null 2>&1; do echo "waiting for xvfb"; done | ||
cache: | ||
directories: | ||
- node_modules | ||
script: ./make-bower-build.sh |
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,47 @@ | ||
#!/usr/bin/env bash | ||
set -e # Exit with nonzero exit code if anything fails | ||
|
||
SOURCE_BRANCH="master" | ||
TARGET_BRANCH="master" | ||
|
||
# Run only test cases if this is not a release | ||
if [ -z "$TRAVIS_TAG" ]; then | ||
echo "Skipping deploy; just doing a build and running test cases" | ||
npm test | ||
exit 0 | ||
fi | ||
|
||
npm test | ||
|
||
# Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc | ||
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 id_ed25519_nginfinite.enc -out deploy_key -d | ||
chmod 600 deploy_key | ||
eval `ssh-agent -s` | ||
ssh-add deploy_key | ||
|
||
BOWER_REPO='[email protected]:ng-infinite-scroll/ng-infinite-scroll-bower.git' | ||
|
||
BOWER_REPO_DIR='out' | ||
CWD="$PWD" | ||
|
||
git clone $BOWER_REPO $BOWER_REPO_DIR | ||
cd $BOWER_REPO_DIR | ||
git checkout $TARGET_BRANCH || git checkout -b $TARGET_BRANCH | ||
|
||
git config user.name "Travis CI" | ||
git config user.email "$COMMIT_AUTHOR_EMAIL" | ||
|
||
# Copy all build content to the bower repo | ||
cp -r ../build . | ||
cp -r ../src . | ||
|
||
git add build | ||
git add src | ||
|
||
git commit -am "Release version $TRAVIS_TAG" | ||
git tag "$TRAVIS_TAG" | ||
git push origin $TARGET_BRANCH $TRAVIS_TAG |