forked from PanierAvide/OsmInEdit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
40 lines (35 loc) · 1.92 KB
/
.gitlab-ci.yml
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
image: node:9-stretch
before_script:
- node --version
- npm --version
- npm install
- apt-get update -qq && apt-get install -y -qq ncftp zip sed
cache:
paths:
- node_modules/
test:
script:
- npm run test
- npm run doc:js:check
deploy:develop:
stage: deploy
only:
- develop
script:
- ./embed_git_hash.sh
- npm run build
- npm run doc
- ncftpput -u "${FTP_USERNAME}" -p "${FTP_PASSWORD}" -R osminedit.pavie.info /web/dev/ ./build/*
- ncftpput -u "${FTP_USERNAME}" -p "${FTP_PASSWORD}" -R osminedit.pavie.info /web/dev/doc/ ./doc/*
deploy:master:
stage: deploy
only:
- master
script:
- echo "{\"editor_name\":\"OsmInEdit\",\"hash\":\"GIT_HASH\",\"data_min_zoom\":18,\"map_initial_zoom\":18,\"map_initial_latlng\":[48.13678,-1.69533],\"providers\":{\"bing\":\"AhsSQakuHuX3ozMBXC60w-hPk0KD_smZZbHLjb7mBFfeIwDKJnJn2_qK3qQfYfPZ\"},\"osm_api_url\":\"https://www.openstreetmap.org\",\"oauth_consumer_key\":\"3lzD17wk8BNT22p5M2HE261mV4gbziyA7W2mbB1l\",\"oauth_secret\":\"n2TgSEakcg46eQWDXyCwlrWwIxMrWdbYV7Yw4xmm\",\"always_authenticated\":false}" > ./public/config.json
- ./embed_git_hash.sh
- sed -i 's#</head>#<script type="text/javascript">var _paq = window._paq || []; _paq.push(["setDoNotTrack", true]); _paq.push(["disableCookies"]); _paq.push(["trackPageView"]); _paq.push(["enableLinkTracking"]); (function() { var u="//stats.pavie.info/"; _paq.push(["setTrackerUrl", u+"matomo.php"]); _paq.push(["setSiteId", "12"]); var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript"; g.async=true; g.defer=true; g.src=u+"matomo.js"; s.parentNode.insertBefore(g,s); })();</script></head>#' public/index.html
- npm run build
- npm run doc
- ncftpput -u "${FTP_USERNAME}" -p "${FTP_PASSWORD}" -R osminedit.pavie.info /web/ ./build/*
- ncftpput -u "${FTP_USERNAME}" -p "${FTP_PASSWORD}" -R osminedit.pavie.info /web/doc/ ./doc/*