common.gitlab-ci.yml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 --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
  34. - npm install
  35. - npm run build:aktivisda
  36. - npm run build:backtivisda
  37. only:
  38. - main
  39. tags:
  40. - docker
  41. ##########
  42. # Deploy #
  43. ##########
  44. deploy-server:
  45. stage: deploy
  46. image: debian:10
  47. before_script:
  48. script:
  49. - apt-get update
  50. - apt-get install -y lftp
  51. - 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"
  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/backtivisda $REMOTE_DIR/backtivisda;exit"
  53. only:
  54. - main
  55. when: manual
  56. tags:
  57. - docker
  58. needs: ['build']
  59. dependencies: ['build']