forked from IvyApp/ivy-sortable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish-build.sh
executable file
·50 lines (41 loc) · 1.51 KB
/
publish-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
42
43
44
45
46
47
48
49
50
#!/usr/bin/env bash
echo "Building standalone library..."
cd standalone
rm -rf dist
../node_modules/.bin/broccoli build dist
git config --global user.email "[email protected]"
git config --global user.name "Dray Lacy"
# The repository we are going to work with.
COMPONENTS_REPO_SLUG="IvyApp/components-ivy-sortable"
# The user who is associated with GH_TOKEN.
USER="omghax"
echo -e "COMPONENTS_REPO_SLUG: ${COMPONENTS_REPO_SLUG}\n"
echo -e "CURRENT_BRANCH: ${TRAVIS_BRANCH}\n"
# Set channel to publish to. If no suitable branch is found exit successfully.
case $TRAVIS_BRANCH in
"master" )
CHANNEL="canary" ;;
"beta" )
CHANNEL="beta" ;;
"stable" )
CHANNEL="release" ;;
"release" )
CHANNEL="release" ;;
* )
echo "Not a bower release branch. Exiting!"
exit 0 ;;
esac
echo -e "CHANNEL: ${CHANNEL}\n"
# Sending output to /dev/null to prevent GH_TOKEN leak on error.
git clone --branch ${CHANNEL} https://${USER}:${GH_TOKEN}@github.com/${COMPONENTS_REPO_SLUG}.git bower_ivy_sortable &> /dev/null
rm -rf bower_ivy_sortable/*
cp -R dist/* bower_ivy_sortable/
cd bower_ivy_sortable
git remote rm origin
# Sending output to /dev/null to prevent GH_TOKEN leak on error.
git remote add origin https://${USER}:${GH_TOKEN}@github.com/${COMPONENTS_REPO_SLUG}.git &> /dev/null
git add -A
git commit -m "Bower auto-build for https://github.com/IvyApp/ivy-sortable/commits/${TRAVIS_COMMIT}."
# Sending output to /dev/null to prevent GH_TOKEN leak on error.
git push -fq origin ${CHANNEL} &> /dev/null
echo -e "Done\n"