.gitlab-ci.yml 1.36 KB
Newer Older
okhin's avatar
okhin committed
1
stages:
Thibaut Broggi's avatar
Thibaut Broggi committed
2
        - test
okhin's avatar
okhin committed
3 4
        - deploy

Thibaut Broggi's avatar
Thibaut Broggi committed
5 6 7 8 9 10 11 12 13 14 15
unit tests:
        variables:
                BASE_PATH: /srv/generateur-slogans
        stage: test
        tags: [preprod]
        script:
                - rsync -ruvC ./ $BASE_PATH
                - cd $BASE_PATH
                - rm -rf node_modules/
                - npm install
                - cp config.json.default config.json
16
                - npm test
Thibaut Broggi's avatar
Thibaut Broggi committed
17

okhin's avatar
okhin committed
18 19 20 21 22
deploy preprod:
        variables:
                BASE_PATH: /srv/generateur-slogans
        stage: deploy
        tags: [preprod]
Thibaut Broggi's avatar
Thibaut Broggi committed
23
        script:
okhin's avatar
okhin committed
24
                - rsync -ruvC ./ $BASE_PATH
25
                - cd $BASE_PATH
okhin's avatar
okhin committed
26
                - rm -rf node_modules/
27
                - npm install
Thibaut Broggi's avatar
Thibaut Broggi committed
28
                - cp config.json.default config.json
okhin's avatar
okhin committed
29 30
                - sudo /usr/bin/pm2 restart slogan
                - sudo /usr/bin/pm2 show slogan
31
        only:
32
                - preprod
okhin's avatar
okhin committed
33 34 35 36 37 38

deploy prod:
        variables:
                BASE_PATH: /srv/soutien/generateur-slogans
        stage: deploy
        tags: [prod]
Thibaut Broggi's avatar
Thibaut Broggi committed
39
        script:
okhin's avatar
okhin committed
40 41 42
                - rsync -ruvC ./ $BASE_PATH
                - cd $BASE_PATH
                - rm -rf node_modules/
43
                - npm install --production
okhin's avatar
okhin committed
44 45 46 47 48 49
                - cp config.json.default config.json
                - sudo /usr/bin/pm2 restart slogan
                - sudo /usr/bin/pm2 show slogan
        only:
                - master