common.gitlab-ci.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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: ubuntu:latest
  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. - apt-get update
  23. - apt-get install -y software-properties-common
  24. - add-apt-repository ppa:inkscape.dev/stable
  25. - apt install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
  26. - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
  27. - sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
  28. - apt-get update
  29. - apt-get install -y google-chrome-stable
  30. - apt-get install -y git
  31. - apt-get install -y nodejs
  32. - apt-get install -y npm
  33. - git clone https://framagit.org/aktivisda/aktivisda.git aktivisda-core
  34. - npm install
  35. - npm run build:aktivisda
  36. - npm run build:backtivisda
  37. only:
  38. - main
  39. tags:
  40. - docker
  41. - localhost
  42. ##########
  43. # Deploy #
  44. ##########
  45. deploy-server:
  46. stage: deploy
  47. image: debian:10
  48. before_script:
  49. script:
  50. - apt-get update
  51. - apt-get install -y lftp
  52. - 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"
  53. - 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"
  54. only:
  55. - main
  56. when: manual
  57. tags:
  58. - docker
  59. needs: ['build']
  60. dependencies: ['build']