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

5
before_script:
6
    - apk add bash --no-cache
7

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

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
    environment: ${CI_BUILD_REF_NAME}
28 29
    except:
        - assets
30

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

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

deploy-master:
    <<: *deploy_template
65 66
    environment:
        name: master
67
        url: https://extensions.typo3.org/
68 69 70 71
    only:
        - master

deploy-develop:
72
    <<: *deploy_template
73 74
    environment:
        name: develop
75
        url: https://extensions-dev.typo3.org/
76 77
    only:
        - develop
78 79 80 81

dump-assets:
    <<: *deploy_template
    stage: dump
82
    image: alpine:3.5
83 84 85 86 87
    artifacts:
        paths:
            - ./assets/
        expire_in: '7d'
    script:
88
      - apk add rsync --no-cache
89
      - rsync -ah -e "ssh -p 22179" extensionsdev@extensions-dev.typo3.org:ci/shared/ ./assets/
90
      - 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
91 92
    dependencies:
    when:
93
    only:
94 95
        - assets
    except: