Projekt

Obecné

Profil

Stáhnout (1.49 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 52268d9b vastja
    - build
6 aaf871a6 Tomáš
    - linter
7 ea92a5e5 vastja
    - test
8 51c818a1 vastja
    - deploy
9 ea92a5e5 vastja
    
10 52268d9b vastja
build:
11
    stage: build
12 2ec14ba9 vastja
    tags:
13 2307b018 vastja
        - build
14 27460050 vastja
    script:
15 8b6777ff vastja
        # Test whether container can be build or not
16 ea92a5e5 vastja
        - ./scripts/build.sh
17
        - docker-compose stop crawler nginx
18 8b6777ff vastja
        # We could also push docker image to some registry or docker hub
19 ea92a5e5 vastja
20 aaf871a6 Tomáš
php_linter: 
21
    stage: linter
22
    tags:
23
        - linter
24
    script:
25
        - ./scripts/composer.sh require --dev squizlabs/php_codesniffer
26
        - cd website
27 127bdcb7 Tomáš
        - docker-compose exec -T php-fpm ./vendor/bin/php-cs-fixer fix /var/www/symfony/src --dry-run --config /var/www/symfony/.php_cs --stop-on-violation --using-cache=no
28 aaf871a6 Tomáš
29
30 ea92a5e5 vastja
tests:
31
    stage: test
32
    tags:
33
        - test
34
    script:
35
        - cd website
36
        - composer require --dev symfony/phpunit-bridge
37
        - composer require --dev symfony/browser-kit symfony/css-selector 
38
        - docker-compose exec -T php-fpm /bin/sh -c "export APP_ENV=test && cd ../symfony && php bin/phpunit"
39
        - docker stop $(docker ps -q)
40 7ba876fd vastja
        
41 5b102971 vastja
deploy_prod:
42
    stage: deploy
43
    tags:
44
        - deploy
45 6bdf30f4 vastja
    variables:
46
        GIT_STRATEGY: none
47 57b88434 vastja
    environment:
48
        name: heatmap
49
        url: https://heatmap.zcu.cz
50 5b102971 vastja
    script:
51 6f6156eb ballakt
        - 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"
52 b448f1d7 vastja
    only:
53
        - master
54 5b102971 vastja
    when: manual