forked from sc-date-time/sc-date-time
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-bower-build.sh
executable file
·41 lines (32 loc) · 1005 Bytes
/
make-bower-build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/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
exit 0
fi
# Get the deploy key by using Travis's stored variables.
openssl aes-256-cbc -K $encrypted_61b055e6e5f9_key -iv $encrypted_61b055e6e5f9_iv -in id_rsa.enc -out deploy_key -d
chmod 600 deploy_key
eval `ssh-agent -s`
ssh-add deploy_key
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
git rm -rf .
cp -r ../dist .
cp ../inert-bower.json bower.json
cp ../LICENSE LICENSE
git add dist
git add bower.json
git add LICENSE
git commit -am "Release version $TRAVIS_TAG"
git tag -d "$TRAVIS_TAG" || true
git tag "$TRAVIS_TAG"
git push origin -f $TARGET_BRANCH $TRAVIS_TAG