.gitlab-ci.yml 1.7 KB
Newer Older
1
variables:
Øyvind gjesdal's avatar
Øyvind gjesdal committed
2
  DEST: /var/www/html/marcus-admin/components
3
4
5
6
7
8
9
10
11
12
stages:   
- build
- deploy
- deploy_prod
build:
  image: oyvindlg/gitlab-ci-library:node-6
  stage: "build"
  before_script:
  - npm install -g gulp@3.9.0
  - npm install gulp@3.9.0
Øyvind gjesdal's avatar
debug    
Øyvind gjesdal committed
13
  script:
Øyvind gjesdal's avatar
Øyvind gjesdal committed
14
  - npm install --ignore-scripts
15
16
17
  - rm -rf node_modules/semantic/dist static/semantic/components && cp -r node_modules/semantic-ui static/semantic/
  - cp -f ./static/themes/default.theme.config ./static/semantic/src/theme.config && cp -f ./default.semantic.json static/semantic/semantic.json && cp -r static/themes/uib static/semantic/src/themes/
  - cd static/semantic && gulp build
Øyvind gjesdal's avatar
Øyvind gjesdal committed
18
19
  artifacts:
    paths:
Øyvind gjesdal's avatar
Øyvind gjesdal committed
20
21
    - static/semantic/
    - node_modules/leaflet
22
    - node_modules/openseadragon
23
24
25
26
27
28
29
30

deploy:
  image: oyvindlg/gitlab-ci-library:node
  stage: deploy
  before_script: 
  - eval $(ssh-agent -s)
  - echo $MARCUS_TEST_KEY | base64 --decode | ssh-add -
  script:
31
  - rsync -v -r -e "ssh -o StrictHostKeyChecking=no" --keep-dirlinks --exclude-from=rsync-exclude.txt --delete ./ $MARCUS_USER@"[$MARCUS_TEST_SERVER_IPV6]":$DEST
32
33
34
35
36
37
38
39
40
41
  tags:
  - spes

deploy_prod:
  image: oyvindlg/gitlab-ci-library:node
  stage: deploy_prod
  before_script:
  - eval $(ssh-agent -s)
  - echo $MARCUS_PROD_KEY | base64 --decode | ssh-add -
  script:
ØyvindG's avatar
ØyvindG committed
42
  - ssh  -o StrictHostKeyChecking=no -6 $MARCUS_USER@"$MARCUS_SERVER_IPV6" echo 'hello'
ØyvindG's avatar
ØyvindG committed
43
  -  rsync -v -r -e "ssh -o StrictHostKeyChecking=no" --exclude 'static/js/blackbox-search' --delete ./ $MARCUS_USER@"[$MARCUS_SERVER_IPV6]":"$DEST"
ØyvindG's avatar
ØyvindG committed
44
  - ssh $MARCUS_USER@"$MARCUS_SERVER_IPV6" "sudo /usr/bin/find /var/www/html/marcus-admin/cache -regex .+ -type f -delete"
45
46
47
  tags:
  - spes
  only:
ØyvindG's avatar
ØyvindG committed
48
  - 8-noe-css-har-forsvunnet-i-oppgraderinger-endringer
49
  when: manual