.gitlab-ci.yml 2.16 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 28
    except:
        - assets
29

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

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

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

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

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