-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2.0.1 - using ffe-core@6.0.0, added flow.sh + build.sh
- Loading branch information
Erik Wendel
committed
May 20, 2016
1 parent
78f0dda
commit a1e65a1
Showing
3 changed files
with
48 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash -e | ||
|
||
npm install |
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,41 @@ | ||
#!/bin/bash | ||
|
||
# Makes functions inherit trap ERR | ||
set -E | ||
|
||
|
||
trap 'executionFailed ${LINENO}' ERR | ||
|
||
function main() { | ||
./build.sh | ||
|
||
if should_publish; then | ||
npm run has-published -s || npm publish | ||
fi | ||
} | ||
|
||
function should_publish() { | ||
[[ $GIT_BRANCH =~ ^(origin/)?master$ ]] | ||
} | ||
|
||
# Fail the build if someone tries to send it parameters since script doesn't handle params at the moment. | ||
if [ $# -ne 0 ] ; then | ||
echo "Failed the build. flow.sh does not support input parameters. Input parameters were '$@'" | ||
exit 1; | ||
fi | ||
|
||
function executionFailed() { | ||
# Called when some command fail execution | ||
local self=$(basename "$0") | ||
local parent_lineno="$1" | ||
local message="$2" | ||
local resultCode="${3:-1}" | ||
if [[ -n "$message" ]]; then | ||
echo "${self}: Error on or near line ${parent_lineno}: ${message}; exiting with status ${resultCode}" | ||
else | ||
echo "${self}: Error on or near line ${parent_lineno}; exiting with status ${resultCode}" | ||
fi | ||
exit "${resultCode}" | ||
} | ||
|
||
main |
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