forked from Qwant/qwant-basic-gl-style
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·64 lines (50 loc) · 1.83 KB
/
release.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
set -ev
TAG=`git describe --tags --abbrev=0`
NEW_TAG=`semver -i minor $TAG`
REPO=`git config remote.origin.url`
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
TARGET_BRANCH="gh-pages"
git checkout -b $TARGET_BRANCH
cp ./node_modules/mapbox-gl/dist/mapbox-gl.js ./
cp ./node_modules/mapbox-gl/dist/mapbox-gl-dev.js ./
cp ./node_modules/mapbox-gl/dist/mapbox-gl.css ./
cp ./build/built-style-debug.json ./style-debug.json
cp ./build/built-style.json ./style.json
cp ./build/style-omt.json ./style-omt.json
cp ./build/sprite.json ./sprite.json
cp ./build/sprite.png ./sprite.png
cp ./build/sprite@2x.json ./sprite@2x.json
cp ./build/sprite@2x.png ./sprite@2x.png
cp ./build/font/iconfont* ./
git add mapbox-gl.js mapbox-gl-dev.js mapbox-gl.css
git add style-debug.json style.json style-omt.json
git add sprite*
git add iconfont*
git config user.name "Travis CI"
git config user.email "$COMMIT_AUTHOR_EMAIL"
ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in ./deploy_key.enc -out ./deploy_key -d
chmod 600 ./deploy_key
eval `ssh-agent -s`
ssh-add deploy_key
git commit --message "gh-pages precommit $NEW_TAG"
git push $SSH_REPO $TARGET_BRANCH -f
# add screenshots
mkdir preview
cd preview
docker pull klokantech/thumbnail-gl
docker run -v $(pwd):/data klokantech/thumbnail-gl "https://qwantresearch.github.io/qwant-basic-gl-style/style-omt.json" "-x 2.3061 -y 48.8811 -z 7 -w 800 -h 600 -r 2"
cd ..
git add preview/*
mv ghpages-readme README.md
git add README.md
# commit again with screenshots
git commit --message "gh-pages update $NEW_TAG"
git push $SSH_REPO $TARGET_BRANCH -f
git checkout master
git tag "v$NEW_TAG"
git push --tags $SSH_REPO master