common.gitlab-ci.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. stages:
  2. - build
  3. - deploy
  4. variables:
  5. GIT_SSL_NO_VERIFY: 'true'
  6. GIT_STRATEGY: clone
  7. #############
  8. # Build App #
  9. #############
  10. build:
  11. stage: build
  12. when: manual
  13. image: node:21
  14. artifacts:
  15. expire_in: 1 day
  16. paths:
  17. - aktivisda-core/dist
  18. variables:
  19. PUBLIC_PATH: $ROOT_URL
  20. script:
  21. - echo "building app for any push on any branch or for release tags..."
  22. - git clone --depth 1 https://framagit.org/aktivisda/aktivisda.git -b $(python3 -c "import json; x = json.load(open('local/localconfig.json', 'r')); print(x['aktivisda']['ref'] if 'aktivisda' in x else 'main')") aktivisda-core
  23. - cd aktivisda-core/aktivisda-library
  24. - npm install
  25. - npm run build
  26. - cd ../..
  27. - npm install
  28. - npm run build:aktivisda
  29. - npm run build:backtivisda
  30. only:
  31. - main
  32. tags:
  33. - docker
  34. ##########
  35. # Deploy #
  36. ##########
  37. deploy-server:
  38. stage: deploy
  39. image: debian:10
  40. before_script:
  41. script:
  42. - apt-get update
  43. - apt-get install -y lftp
  44. - lftp -e "set ssl:verify-certificate no;set sftp:auto-confirm yes;open sftp://$FTP_HOST -p $FTP_PORT; user $FTP_USER $FTP_PASSWORD; mirror --reverse --verbose --delete aktivisda-core/dist/aktivisda $REMOTE_DIR;exit"
  45. - lftp -e "set ssl:verify-certificate no;set sftp:auto-confirm yes;open sftp://$FTP_HOST -p $FTP_PORT; user $FTP_USER $FTP_PASSWORD; mirror --reverse --verbose --delete aktivisda-core/dist/backtivisda $REMOTE_DIR/backtivisda;exit"
  46. only:
  47. - main
  48. when: manual
  49. tags:
  50. - docker
  51. needs: ['build']
  52. dependencies: ['build']