Projekt

Obecné

Profil

Stáhnout (1.41 KB) Statistiky
| Větev: | Revize:
1 8b6777ff vastja
# variables:
2
#     IMAGE_NAME: zcu-campus-life-app:$CI_COMMIT_REF_NAME
3 7ba876fd vastja
4 27460050 vastja
stages:
5 7ba876fd vastja
    - test
6 52268d9b vastja
    - build
7 51c818a1 vastja
    - deploy
8 8b6777ff vastja
9
# Now the runner is on the same server as production environment - which is not good - so ssh is not needed    
10 7ba876fd vastja
# before_script:
11
#     - apt-get update -qq
12
#     - apt-get install -qq git
13
#     # Setup SSH deploy keys
14
#     - 'which ssh-agent || ( apt-get install -qq openssh-client )'
15
#     - eval $(ssh-agent -s)
16
#     - ssh-add <(echo "$SSH_PRIVATE_KEY")
17
#     - mkdir -p ~/.ssh
18
#     - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
19
    
20
unit_tests:
21
    image: php:7.2-alpine
22
    stage: test
23
    script:
24
        - apk add composer
25
        - cd website
26
        - composer require --dev symfony/phpunit-bridge
27
        - php bin/phpunit
28
29 52268d9b vastja
build:
30
    stage: build
31 2ec14ba9 vastja
    tags:
32 2307b018 vastja
        - build
33 27460050 vastja
    script:
34 8b6777ff vastja
        # Test whether container can be build or not
35 908c047b vastja
        - docker-compose build
36 8b6777ff vastja
        # We could also push docker image to some registry or docker hub
37 7ba876fd vastja
        
38 5b102971 vastja
deploy_prod:
39
    stage: deploy
40
    tags:
41
        - deploy
42 6bdf30f4 vastja
    variables:
43
        GIT_STRATEGY: none
44 57b88434 vastja
    environment:
45
        name: heatmap
46
        url: https://heatmap.zcu.cz
47 5b102971 vastja
    script:
48
        - cd ~
49 0e044e47 vastja
        - rm -rf aswi2020sebela
50 5b102971 vastja
        - git clone https://gitlab.kiv.zcu.cz/aswi/aswi-2020/aswi2020sebela.git
51 6bdf30f4 vastja
        - cd aswi2020sebela
52 8b6777ff vastja
        - ./build.sh
53 5b102971 vastja
    # only:
54
    #     - master
55
    when: manual