Projekt

Obecné

Profil

Stáhnout (1.46 KB) Statistiky
| Větev: | Revize:
1
stages:
2
    - build
3
    - linter
4
    - test
5
    - deploy
6
    
7
build:
8
    stage: build
9
    tags:
10
        - build
11
    script:
12
        # Test whether container can be build or not
13
        - ./scripts/build.sh
14
        - docker-compose stop crawler nginx
15
        # We could also push docker image to some registry or docker hub
16

    
17
php_linter: 
18
    stage: linter
19
    tags:
20
        - linter
21
    script:
22
        - ./scripts/composer.sh require --dev squizlabs/php_codesniffer
23
        - docker-compose exec -T php-fpm /bin/sh -c "/var/www/symfony/vendor/bin/php-cs-fixer fix /var/www/symfony/src --dry-run --config /var/www/symfony/.php_cs --stop-on-violation --using-cache=no"
24

    
25

    
26
tests:
27
    stage: test
28
    tags:
29
        - test
30
    allow_failure: true
31
    script:
32
        - ./scripts/composer.sh require --dev symfony/phpunit-bridge
33
        - ./scripts/composer.sh require --dev symfony/browser-kit symfony/css-selector         
34
        - docker-compose exec -T php-fpm /bin/sh -c "export APP_ENV=test && cd ../symfony && php bin/phpunit"
35
        - docker stop $(docker ps -q)
36
        
37
deploy_prod:
38
    stage: deploy
39
    tags:
40
        - deploy
41
    variables:
42
        GIT_STRATEGY: none
43
    environment:
44
        name: heatmap
45
        url: https://heatmap.zcu.cz
46
    script:
47
        - 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"
48
    only:
49
        - master
50
    when: manual
(2-2/6)