.gitlab-ci.yml 2.09 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
before_script:
6
    - apk add bash --no-cache
Thomas Löffler's avatar
Thomas Löffler committed
7
8

stages:
Sascha Marcel Schmidt's avatar
Sascha Marcel Schmidt committed
9
    - dump
10
11
12
    - build
    - layout
    - deploy
Thomas Löffler's avatar
Thomas Löffler committed
13
14

build:
15
    stage: build
Thomas Löffler's avatar
Thomas Löffler committed
16
    image: composer
17
18
19
20
    variables:
        GIT_STRATEGY: "clone"
        GIT_SUBMODULE_STRATEGY: "recursive"
    script:
Thomas Löffler's avatar
Thomas Löffler committed
21
22
23
        - composer config store-auths false
        - composer config http-basic.git-t3o.typo3.org gitlab-ci-token ${CI_BUILD_TOKEN}
        - composer install
24
25
26
27
    artifacts:
        paths:
            - ./
        expire_in: '1h'
Sascha Marcel Schmidt's avatar
Sascha Marcel Schmidt committed
28
29
30
    except:
        - assets

31
32
33

layout:
    stage: layout
34
    image: node:7
35
    before_script:
36
       - cd html/typo3conf/ext/t3olayout/Build
37
    script:
38
39
       - npm install
       - npm run build
40
41
42
43
44
45
    artifacts:
        paths:
          - ./
        expire_in: '7d'
    dependencies:
        - build
Sascha Marcel Schmidt's avatar
Sascha Marcel Schmidt committed
46
47
    except:
        - assets
48
49
50

.deploy-template: &deploy_template
    stage: deploy
Sascha Marcel Schmidt's avatar
Sascha Marcel Schmidt committed
51
    before_script:
52
        - apk add openssh-client bash --no-cache
53
54
        - eval $(ssh-agent -s)
        - echo "$SSH_PRIVATE_KEY" | ssh-add -
Sascha Marcel Schmidt's avatar
Sascha Marcel Schmidt committed
55
    script:
56
        - VERSION=4.0.0-alpine ./.gitlab-ci/scripts/deployer.sh -f/src/.gitlab-ci/deployer/deploy.php deploy ${CI_BUILD_REF_NAME}
57
58
59
    when: manual
    dependencies:
        - layout
Sascha Marcel Schmidt's avatar
Sascha Marcel Schmidt committed
60
61
    except:
        - assets
62

63
64
65
66
deploy-master:
    <<: *deploy_template
    environment:
        name: master
67
        url: https://typo3.org/
68
69
    only:
        - master
Thomas Löffler's avatar
Thomas Löffler committed
70

71
72
73
74
deploy-develop:
    <<: *deploy_template
    environment:
        name: develop
75
        url: https://vpro0100.proserver.punkt.de/
76
77
    only:
        - develop
Sascha Marcel Schmidt's avatar
Sascha Marcel Schmidt committed
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

dump-assets:
    <<: *deploy_template
    stage: dump
    image: alpine:3.5
    artifacts:
        paths:
            - ./assets/
        expire_in: '3d'
    script:
      - apk add rsync --no-cache
      - rsync -ah -e "ssh -p 22179" extensionsdev@extensions-dev.typo3.org:ci/shared/ ./assets/
      - ssh -p22179 extensionsdev@extensions-dev.typo3.org "mysqldump -u${DEV_DATABASE_USER} -p${DEV_DATABASE_PASSWORD} -h127.0.0.1 extensionsdev | gzip -9 -c" > ./assets/db.sql.gz
    dependencies:
    when:
    only:
        - assets
    except: