Projekt

Obecné

Profil

Stáhnout (1.19 KB) Statistiky
| Větev: | Revize:
1
image: php:7.2-alpine
2

    
3
variables:
4
    IMAGE_NAME: zcu-campus-life-app:$CI_COMMIT_REF_NAME
5

    
6
stages:
7
    - test
8
    - build
9
    
10
before_script:
11
    - apk update
12
    - apk upgrade
13
    # Setup SSH deploy keys
14
    - 'which ssh-agent || ( apk add -qq openssh-client )'
15
    - eval $(ssh-agent -s)
16
    - "#!/bin/sh -c '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
    stage: test
22
    script:
23
        - apk add composer
24
        - cd website
25
        - composer require --dev symfony/phpunit-bridge
26
        - php bin/phpunit
27

    
28
build:
29
    stage: build
30
    script:
31
        # - docker login -u $USER p $PASSWORD gitlab.kiv.zcu.cz:5000
32
        # Todo propagate image name into docker-compose.yml
33
        - docker-compose build
34
        # - docker-compose push $IMAGE_NAME
35
        
36
# deploy_prod:
37
#     stage: deploy
38
#     environmnet:
39
#         name: deploy
40
#         url: http://whatever.zcu.cz
41
#     script:
42
#         - ssh root@example.com "docker login -u $USER p $PASSWORD gitlab.kiv.zcu.cz:5000 && docker-compose pull $IMAGE_NAME && docker-compose up"
43
#     only:
44
#         - master
45
#     when: manual
(2-2/8)