.gitlab-ci.yml 1.53 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
    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
Thomas Löffler's avatar
Thomas Löffler committed
46
    image: php:7.0-alpine
47 48 49 50 51
    stage: deploy
    script:
        - apk add openssh-client
        - eval $(ssh-agent -s)
        - echo "$SSH_PRIVATE_KEY" | ssh-add -
52
        - php surf.phar deploy Development
53 54 55
    when: manual
    dependencies:
        - layout
56

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

65 66 67 68
deploy-develop:
    <<: *deploy_template
    environment:
        name: develop
69
        url: https://vpro0100.proserver.punkt.de/
70 71
    only:
        - develop
72
        - 9-add-deployment-on-staging-server