Projekt

Obecné

Profil

Stáhnout (1.17 KB) Statistiky
| Větev: | Revize:
1
# variables:
2
#     IMAGE_NAME: zcu-campus-life-app:$CI_COMMIT_REF_NAME
3

    
4
stages:
5
    - test
6
    - linter
7
    - build
8
    - deploy
9

    
10
unit_tests:
11
    stage: test
12
    tags:
13
        - test
14
    script:
15
        - cd website
16
        - composer require --dev symfony/phpunit-bridge
17
        - php bin/phpunit
18
php_linter: 
19
    stage: linter
20
    tags:
21
        - linter
22
    script:
23
        - cd website
24
        - composer require --dev squizlabs/php_codesniffer
25
        - ./vendor/bin/php-cs-fixer fix --dry-run --config .php_cs --stop-on-violation --using-cache=no
26
build:
27
    stage: build
28
    tags:
29
        - build
30
    script:
31
        # Test whether container can be build or not
32
        - docker-compose build
33
        # We could also push docker image to some registry or docker hub
34
        
35
deploy_prod:
36
    stage: deploy
37
    tags:
38
        - deploy
39
    variables:
40
        GIT_STRATEGY: none
41
    environment:
42
        name: heatmap
43
        url: https://heatmap.zcu.cz
44
    script:
45
        - ssh root@heatmap.zcu.cz "cd ~ && rm -rf aswi2020sebela && git clone https://gitlab.kiv.zcu.cz/aswi/aswi-2020/aswi2020sebela.git && cd aswi2020sebela && ./scripts/build.sh && exit"
46
    only:
47
        - master
48
    when: manual
(2-2/6)