.gitlab-ci.yml 1.19 KB
Newer Older
1
cache:
Thomas Löffler's avatar
Thomas Löffler committed
2
  key: "$CI_BUILD_NAME-$CI_BUILD_REF_NAME"
3 4 5 6 7 8 9 10 11 12 13 14 15
  untracked: true
  paths:
    - cache/

stages:
  - build
  - upload


# TER Upload when tagging in master branch
# The variables T3O_USERNAME and T3O_PASSWORD should be set in GitLab
ter-upload:
  stage: upload
Thomas Löffler's avatar
Thomas Löffler committed
16
  image: composer:1
17 18 19 20
  only:
    - tags
  before_script:
    - export COMPOSER_CACHE_DIR=/cache/composer
21 22 23
    - apk update
    - apk add  --no-cache libmcrypt  git mysql-client curl wget --virtual .build-deps freetype libxml2-dev libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev libmcrypt-dev
    - docker-php-ext-install soap
24
  script:
Thomas Löffler's avatar
Thomas Löffler committed
25
    - composer global require namelesscoder/typo3-repository-client
26 27
    - export TYPO3_PATH_WEB="$PWD/.Build/Web"
    - >
28 29
      if [ -n "$CI_COMMIT_TAG" ] && [ -n "$T3O_USERNAME" ] && [ -n "$T3O_PASSWORD" ]; then
        echo -e "Preparing upload of release ${CI_COMMIT_TAG} to TER\n"
30 31 32
        # Cleanup before we upload
        git reset --hard HEAD && git clean -fx
        # Upload
33 34
        TAG_MESSAGE=`git tag -n10 -l $CI_COMMIT_TAG | sed 's/^[0-9.]*[ ]*//g'`
        echo "Uploading release ${CI_COMMIT_TAG} to TER"
Thomas Löffler's avatar
Thomas Löffler committed
35 36
        /tmp/vendor/bin/upload . "$T3O_USERNAME" "$T3O_PASSWORD" "$TAG_MESSAGE"
      fi;