.gitlab-ci.yml 1.48 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
    artifacts:
        paths:
            - ./
        expire_in: '1h'
    environment: ${CI_BUILD_REF_NAME}

layout:
    stage: layout
31
    image: node:7
32
    before_script:
33
       - cd Build
34
    script:
35 36
       - npm install
       - npm run build
37 38 39 40 41 42 43 44 45 46 47
    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