Skip to content

Commit 18fdd1b

Browse files
committed
Merge pull request #524 from lewisl9029/feature-deferred-gh-pages-clone
Feature deferred gh pages clone
2 parents ed6db88 + 2fa4a90 commit 18fdd1b

File tree

5 files changed

+37
-43
lines changed

5 files changed

+37
-43
lines changed

circle.yml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# machine:
2-
# services:
3-
# - docker
4-
51
machine:
62
node:
73
version: 4.2.1
@@ -19,23 +15,22 @@ dependencies:
1915
- "~/nvm/versions/node/v4.2.1/lib/node_modules"
2016
- "~/nvm/versions/node/v4.2.1/bin"
2117
pre:
22-
- /bin/bash scripts/toc-install-deps.sh
18+
- >
19+
if [ ! -e ~/nvm/versions/node/v4.2.1/bin/npm ] || \
20+
[ ! -e ~/nvm/versions/node/v4.2.1/bin/gulp ] || \
21+
[ ! -e ~/nvm/versions/node/v4.2.1/bin/http-server ] || \
22+
[ ! -e ~/nvm/versions/node/v4.2.1/bin/jspm ] || \
23+
[ ! -e ~/nvm/versions/node/v4.2.1/bin/ionic ];
24+
then
25+
/bin/bash scripts/toc-install-deps.sh
26+
else
27+
echo "Cached global dependencies exist. Skipping install."
28+
fi
2329
override:
2430
- npm install
2531
- npm rebuild node-sass
2632
- npm rebuild optipng-bin
2733
- jspm install
28-
# - >
29-
# docker run \
30-
# -v $(pwd):/toc \
31-
# lewisl9029/toc-dev:latest \
32-
# npm install
33-
# - >
34-
# docker run \
35-
# -v $(pwd):/toc \
36-
# -e JSPM_GITHUB_AUTH_TOKEN=$JSPM_GITHUB_AUTH_TOKEN \
37-
# lewisl9029/toc-dev:latest \
38-
# jspm install
3934

4035
test:
4136
override:
@@ -46,11 +41,9 @@ deployment:
4641
branch: /.*/
4742
owner: lewisl9029
4843
commands:
49-
- /bin/bash scripts/toc-deploy-prepare.sh
5044
- /bin/bash scripts/toc-deploy-staging.sh
5145
production:
5246
tag: /v[0-9]+(\.[0-9]+)*/
5347
owner: lewisl9029
5448
commands:
55-
- /bin/bash scripts/toc-deploy-prepare.sh
5649
- /bin/bash scripts/toc-deploy-production.sh

scripts/toc-deploy-prepare.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

scripts/toc-deploy-production.sh

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,8 @@ set -e
44
TOC_VERSION="$(git describe --abbrev=0 --tags)"
55
TOC_RELEASE=$TOC_VERSION
66
TOC_URL="http://toc.im/releases/$TOC_RELEASE"
7+
TOC_ENV="production"
78

89
gulp package --prod
910

10-
rm -rf ../toc-pages/app
11-
rm -rf ../toc-pages/index.html
12-
rm -rf ../toc-pages/landing.css
13-
rm -rf ../toc-pages/landing.js
14-
15-
cp -r www/* ../toc-pages/
16-
17-
# clean up previous staging releases
18-
rm -rf ../toc-pages/releases/staging
19-
2011
source scripts/toc-deploy-publish.sh

scripts/toc-deploy-publish.sh

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,34 @@
11
#!/usr/bin/env bash
22
set -e
33

4-
rm -rf ../toc-pages/releases/$TOC_RELEASE
5-
6-
mkdir -p ../toc-pages/releases/$TOC_RELEASE
7-
cp -r www/* ../toc-pages/releases/$TOC_RELEASE/
8-
94
tar -cvf "$CIRCLE_ARTIFACTS/Toc Messenger.tar" www
105
cp "Toc Messenger.apk" $CIRCLE_ARTIFACTS/
116
cp "Toc Messenger.ipa" $CIRCLE_ARTIFACTS/
127

8+
git config --global user.email "[email protected]"
9+
git config --global user.name "Lewis Liu"
10+
git config --global push.default matching
11+
12+
git clone [email protected]:lewisl9029/toc.git ../toc-pages \
13+
--branch gh-pages --depth 1
14+
15+
if [ $TOC_ENV == "production" ];
16+
then
17+
rm -rf ../toc-pages/app
18+
rm -rf ../toc-pages/index.html
19+
rm -rf ../toc-pages/landing.css
20+
rm -rf ../toc-pages/landing.js
21+
22+
cp -r www/* ../toc-pages/
23+
24+
# clean up previous staging releases
25+
rm -rf ../toc-pages/releases/staging
26+
fi
27+
28+
rm -rf ../toc-pages/releases/$TOC_RELEASE
29+
30+
mkdir -p ../toc-pages/releases/$TOC_RELEASE
31+
cp -r www/* ../toc-pages/releases/$TOC_RELEASE/
1332

1433
cd ../toc-pages
1534

@@ -19,5 +38,4 @@ git push origin gh-pages
1938

2039
cd ../toc
2140

22-
2341
echo $TOC_URL

scripts/toc-deploy-staging.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ set -e
44
TOC_VERSION="$(git describe --abbrev=0 --tags)"
55
TOC_RELEASE="staging/$CIRCLE_BRANCH"
66
TOC_URL="http://toc.im/releases/$TOC_RELEASE"
7+
TOC_ENV="staging"
78

89
TOC_COMMIT_VERSION="v$(git log --format=%B -n 1)"
910

0 commit comments

Comments
 (0)