Skip to content

Commit 3ed0e8e

Browse files
cal-smithGitHub Enterprise
authored andcommitted
Merge pull request #3 from callums/master
Remove more sensative information
2 parents 011a0f4 + 19298fe commit 3ed0e8e

File tree

5 files changed

+124
-0
lines changed

5 files changed

+124
-0
lines changed

.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
dist: trusty
2+
language: node_js
3+
node_js:
4+
- '8'
5+
addons:
6+
chrome: stable
7+
before_install:
8+
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
9+
before_script:
10+
- export DISPLAY=:99.0
11+
- sh -e /etc/init.d/xvfb start
12+
script: npm test && npm run lint && npm run demo:build
13+
sudo: false
14+
deploy:
15+
skip_cleanup: true
16+
provider: script
17+
script: bash ./scripts/deploy.sh
18+
on:
19+
all_branches: true
20+
repo: ibm/carbon-components-angular

LICENSE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2018 IBM
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

scripts/build.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
set -e # exit with nonzero exit code if anything fails
4+
5+
rm -rf dist
6+
gulp build
7+
ngc -p tsconfig-aot.json
8+
webpack --config webpack.build.js
9+
rm -rf dist/src dist/waste demo/bundle/documentation
10+
11+
gulp build:meta
12+
13+
npm run docs:build && mv documentation demo/bundle/

scripts/deploy.sh

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/usr/bin/env bash
2+
3+
set -e # exit with nonzero exit code if anything fails
4+
5+
# exit with an error if the build fails
6+
if [[ ${TRAVIS_TEST_RESULT=0} == 1 ]]; then
7+
exit 1;
8+
fi
9+
10+
# exit if the branch is wrong
11+
if [[ ${TRAVIS_BRANCH} =~ (master$|beta$|^v?[0-9]*\.[0-9]*\.[0-9]*$) || ${TRAVIS_EVENT_TYPE} == 'cron' ]]; then
12+
npm run build
13+
cd dist
14+
15+
#setup npm publishing
16+
npm publish
17+
18+
if [[ ${TRAVIS_BRANCH} =~ (master$|beta$|^v?[0-9]*\.[0-9]*\.[0-9]*$) ]]; then
19+
# Move to the top level folder, and make a "deploy" directory
20+
cd ../
21+
mkdir deploy
22+
cd deploy
23+
git init
24+
25+
# Configure Git
26+
git config user.name "Travis CI"
27+
git config user.email "[email protected]"
28+
29+
# pull the upstream pages
30+
git pull "[email protected]:ibm/carbon-components-angular.git" gh-pages
31+
32+
# copy to the master/alpha folder
33+
if [[ ${TRAVIS_BRANCH} == "master" ]]; then
34+
cp -R ../demo/bundle/* ./
35+
# copy to the beta folder
36+
elif [[ ${TRAVIS_EVENT_TYPE} == "cron" ]]; then
37+
mkdir -p beta
38+
cp -R ../demo/bundle/* beta
39+
# copy to the version folder
40+
elif [[ ${TRAVIS_BRANCH} =~ (^v?[0-9]*\.[0-9]*\.[0-9]*$) ]]; then
41+
mkdir -p $TRAVIS_BRANCH
42+
cp -R ../demo/bundle/* $TRAVIS_BRANCH
43+
fi
44+
45+
# in this case we want the script to keep running, so we can actually check the $? (status) var
46+
set +e
47+
# Commit all the things into the repo
48+
git add .
49+
git commit -m "Deploy to GitHub Pages"
50+
51+
# Force push to gh-pages if there was something to commit
52+
if [ $? -eq 0 ]; then
53+
git push --force "[email protected]:ibm/carbon-components-angular.git" master:gh-pages > /dev/null 2>&1
54+
fi
55+
exit 0;
56+
fi
57+
else
58+
echo "Branch type not recognized";
59+
echo "Skipping deploy";
60+
exit 0;
61+
fi

scripts/prepush.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
[email protected]:ibm/carbon-components-angular.git
6+
7+
# Refresh code
8+
git pull upstream master
9+
10+
if [ $? -ne 0 ]
11+
then
12+
echo "Error: Couldn't pull from upstream."
13+
echo "Try running 'git remote add upstream $GITHUB_UPSTREAM' and try again."
14+
exit 1
15+
fi
16+
17+
#exit 1 # stops push from running, good for testing

0 commit comments

Comments
 (0)