.gitlab-ci.yml 1.55 KB
Newer Older
Thomas Löffler's avatar
Thomas Löffler committed
1
variables:
2
3
    GIT_STRATEGY: "none"
    GIT_SSL_NO_VERIFY: "true"
Thomas Löffler's avatar
Thomas Löffler committed
4

5
6
before_script:
    - apk add bash --update
Thomas Löffler's avatar
Thomas Löffler committed
7
8

stages:
9
10
11
    - build
    - layout
    - deploy
Thomas Löffler's avatar
Thomas Löffler committed
12
13

build:
14
    stage: build
Thomas Löffler's avatar
Thomas Löffler committed
15
    image: composer
16
17
18
19
    variables:
        GIT_STRATEGY: "clone"
        GIT_SUBMODULE_STRATEGY: "recursive"
    script:
Thomas Löffler's avatar
Thomas Löffler committed
20
21
22
        - composer config store-auths false
        - composer config http-basic.git-t3o.typo3.org gitlab-ci-token ${CI_BUILD_TOKEN}
        - composer install
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
    artifacts:
        paths:
            - ./
        expire_in: '1h'
    environment: ${CI_BUILD_REF_NAME}

layout:
    stage: layout
    image: montoias/docker-nodejs-bower-grunt-compass:v2
    before_script:
        - cd html/typo3conf/ext/t3olayout/Resources/Private
    script:
        - npm install
        - grunt
    artifacts:
        paths:
          - ./
        expire_in: '7d'
    environment: ${CI_BUILD_REF_NAME}
    dependencies:
        - build

.deploy-template: &deploy_template
    stage: deploy
    script:
48
        - apk add openssh-client rsync
49
50
        - eval $(ssh-agent -s)
        - echo "$SSH_PRIVATE_KEY" | ssh-add -
51
        - VERSION=4.0.0-alpine ./.gitlab-ci/scripts/deployer.sh -f/src/.gitlab-ci/deployer/deploy.php deploy ${CI_BUILD_REF_NAME}
52
53
54
    when: manual
    dependencies:
        - layout
55

56
57
58
59
deploy-master:
    <<: *deploy_template
    environment:
        name: master
60
        url: https://typo3.org/
61
62
    only:
        - master
Thomas Löffler's avatar
Thomas Löffler committed
63

64
65
66
67
deploy-develop:
    <<: *deploy_template
    environment:
        name: develop
68
        url: https://vpro0100.proserver.punkt.de/
69
70
    only:
        - develop