.gitlab-ci.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. image: node:16
  2. before_script:
  3. - node --version
  4. - npm --version
  5. - npm install
  6. - apt-get update -qq && apt-get install -y -qq ncftp zip sed
  7. cache:
  8. paths:
  9. - node_modules/
  10. test:
  11. script:
  12. - npm run test
  13. - npm run doc:js:check
  14. deploy:develop:
  15. stage: deploy
  16. only:
  17. - develop
  18. script:
  19. - ./embed_git_hash.sh
  20. - npm run build
  21. - npm run doc
  22. - ncftpput -u "${FTP_USERNAME}" -p "${FTP_PASSWORD}" -R osminedit.pavie.info /web/dev/ ./build/*
  23. - ncftpput -u "${FTP_USERNAME}" -p "${FTP_PASSWORD}" -R osminedit.pavie.info /web/dev/doc/ ./doc/*
  24. deploy:master:
  25. stage: deploy
  26. only:
  27. - master
  28. script:
  29. - 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\":\"JcFvAydlXj3Krm6M2eNLxvh4rvL2T8JfUn0HfUIEsGk\",\"oauth_secret\":\"M-k2EnprOC606CHsq29bELniV3-kiFL-iwyKbJrCsLs\",\"always_authenticated\":false}" > ./public/config.json
  30. - ./embed_git_hash.sh
  31. - 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
  32. - npm run build
  33. - npm run doc
  34. - ncftpput -u "${FTP_USERNAME}" -p "${FTP_PASSWORD}" -R osminedit.pavie.info /web/ ./build/*
  35. - ncftpput -u "${FTP_USERNAME}" -p "${FTP_PASSWORD}" -R osminedit.pavie.info /web/doc/ ./doc/*