Skip to content

Commit e686e31

Browse files
committed
Improve travis script and run build for tests
1 parent 984a99a commit e686e31

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

.travis.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
language: node_js
22
node_js: 6
33

4-
branches:
5-
only: source
6-
7-
after_success: ./resources/publish.sh
8-
94
env:
105
global:
116
- secure: "HisahnzlpVlTi239Z80UtqRWYEWUBXyVDYsxX9vxwg332jSxO7Hr6TFmNjghpJPtT/HRjQ/FQ4Cfain2ae2OBi0a1mBNNvOTrfy8/Rvs+FwxlmPolzXKZg1PLx1A9HMlhVkAxYuk5AKv5wLNN3xWzPS9xcHASiCgHE1imq9tuf53tuflNpoAlRT6WVYqxuLluDTbfiTrmjjydfh/iTkYyU7mdfowEyS7+b7ltx8tzGD5Fif1dKBVZEkImxC5KV3oczk5zxIBC/j0SEmd4KLl5NH/kbUcD/mFSgtoKRSW0QwJdwR0I3AurP/D8FlTzVyCwwxMrZfnWjoync1bMJvRbz02KkiICt2lfI0BFo1dDD1yO8lYOhSHcXZRhhEypLu9mho2Cy0zy5zF5PF5t2X8zfGgkQ5eTy6xYCHOAl4eqO9NU2mtpKLdYpXfkBLRTa2e5U+DBqYt8fVXyBR2qVCbpIkg96Hx/FCCKtNlzjyhyTJmyoZr7BxPpHQZkmroieEMfpM7VfF729npf0n6jrfBLwyWFjCFAG9xLey537sUdczEltdWgOuW1rs0KaP4uM1si3S+fNndXLDX70n8BsadnJgq0y1RWAH1y8Y+Pa5cRl0QXQOJUgK4ZcS29+BzZ6RIsFUrAJXHCRdaTDrQNw8CepW443Ke9quwG8IJLCAPV0c="
7+
8+
deploy:
9+
skip_cleanup: true
10+
provider: script
11+
script: ./resources/publish.sh
12+
on:
13+
branch: source

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"start": "rm -rf build && babel-node resources/server.js",
77
"build": "rm -rf build && babel-node resources/build.js",
88
"watch": "rm -rf build && babel-node resources/watch.js",
9-
"test": "exit 0"
9+
"test": "npm run build"
1010
},
1111
"babel": {
1212
"optional": [

resources/publish.sh

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1-
#!/bin/bash
1+
#!/bin/bash -e
22

3-
set -e
3+
# Publishing to NPM is currently supported by Travis CI, which ensures that all
4+
# tests pass first and the deployed module contains the correct file struture.
5+
# In order to prevent inadvertently circumventing this, we ensure that a CI
6+
# environment exists before continuing.
7+
if [ "$CI" != true ]; then
8+
echo "\n\n\n \033[101;30m Only Travis CI can publish to NPM. \033[0m\n\n\n" 1>&2;
9+
exit 1;
10+
fi;
411

5-
# Build the website and copy it to the build folder
6-
npm run build
12+
13+
# Ensure the website was built
14+
if [ ! -f ./build/index.html ]; then
15+
echo "\n\n\n \033[101;30m Something went wrong, the site does not exist. \033[0m\n\n\n" 1>&2;
16+
exit 1;
17+
fi
718

819
# Commit the website and push it
920
cd build

0 commit comments

Comments
 (0)