Projekt

Obecné

Profil

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