.gitlab-ci.yml 2.09 KB
Newer Older
1 2
variables:
    GIT_STRATEGY: "none"
3
    GIT_SSL_NO_VERIFY: "true"
4

5 6 7
before_script:
    - apk add bash --update

8 9
stages:
    - build
10
    - layout
11
    - deploy
12
    - dump
13 14 15

build:
    stage: build
16 17 18
    variables:
        GIT_STRATEGY: "clone"
        GIT_SUBMODULE_STRATEGY: "recursive"
19
    script:
20 21 22
        - ./.gitlab-ci/scripts/composer.sh config store-auths false
        - ./.gitlab-ci/scripts/composer.sh config http-basic.git-t3o.typo3.org gitlab-ci-token ${CI_BUILD_TOKEN}
        - ./.gitlab-ci/scripts/composer.sh install
23 24 25
    artifacts:
        paths:
            - ./
26
        expire_in: '1h'
27 28
    environment: ${CI_BUILD_REF_NAME}

29 30
layout:
    stage: layout
31
    image: node:7
32
    before_script:
33
       - cd html/typo3conf/ext/t3olayout/Build
34
    script:
35 36
       - npm install
       - npm run build
37 38 39 40 41
    artifacts:
        paths:
          - ./
        expire_in: '7d'
    environment: ${CI_BUILD_REF_NAME}
42 43
    dependencies:
        - build
44

45
.deploy-template: &deploy_template
46
    stage: deploy
47
    before_script:
48
        - apk add openssh-client --no-cache
49
        - eval $(ssh-agent -s)
50
        - echo "$SSH_PRIVATE_KEY" | ssh-add -
51
    script:
52
        - ./.gitlab-ci/scripts/deployer.sh -f/src/.gitlab-ci/deployer/deploy.php deploy ${CI_BUILD_REF_NAME}
53
    when: manual
54 55
    dependencies:
        - layout
56 57 58

deploy-master:
    <<: *deploy_template
59 60
    environment:
        name: master
61
        url: https://extensions.typo3.org/
62 63 64 65
    only:
        - master

deploy-develop:
66
    <<: *deploy_template
67 68
    environment:
        name: develop
69
        url: https://extensions-dev.typo3.org/
70 71
    only:
        - develop
72 73 74 75

dump-assets:
    <<: *deploy_template
    stage: dump
76
    image: alpine:3.5
77 78 79 80 81
    artifacts:
        paths:
            - ./assets/
        expire_in: '7d'
    script:
82
      - apk add rsync --no-cache
83
      - rsync -ah -e "ssh -p 22179" extensionsdev@extensions-dev.typo3.org:ci/shared/ ./assets/
84
      - ssh -p22179 extensionsdev@extensions-dev.typo3.org "mysqldump -u${DEV_DATABASE_USER} -p${DEV_DATABASE_PASSWORD} -h127.0.0.1 extensionsdev | gzip -9 -c" > db.sql.gz
85 86
    dependencies:
    when:
87 88
    except:
        - master