.gitlab-ci.yml 2.5 KB
Newer Older
Thomas Löffler's avatar
Thomas Löffler committed
1 2
include:
  - project: 't3o/t3olayout'
3
    ref: main
Thomas Löffler's avatar
Thomas Löffler committed
4
    file: '/Configuration/GitLab/t3o-builds.yml'
5
  - remote: 'https://git.spooner.io/spooner-web/gitlab-anybadge-creator/-/raw/main/anybadges.yml'
6

7 8 9
variables:
  GIT_STRATEGY: "none"
  GIT_SSL_NO_VERIFY: "true"
10
  STAGE_HOST: "typo3.dev"
11
  PRODUCTION_HOST: "typo3.org"
12
  DUMP_USER: "t3o-stage"
13
  STAGE_USER: "t3o-stage"
14
  DUMP_EXCLUDE_TABLES_LIST: "be_groups,be_sessions,be_users,cf_cache_hash,cf_cache_hash_tags,cf_cache_imagesizes,cf_cache_imagesizes_tags,cf_cache_news_category,cf_cache_news_category_tags,cf_cache_pages,cf_cache_pages_tags,cf_cache_pagesection,cf_cache_pagesection_tags,cf_cache_rootline,cf_cache_rootline_tags,cf_extbase_datamapfactory_datamap,cf_extbase_datamapfactory_datamap_tags,cf_extbase_object,cf_extbase_object_tags,cf_extbase_reflection,cf_extbase_reflection_tags,cf_tx_solr,cf_tx_solr_configuration,cf_tx_solr_configuration_tags,cf_tx_solr_tags,fe_groups,fe_sessions,fe_users,sys_domain,sys_log,tx_solr_cache,tx_solr_cache_tags"
Thomas Löffler's avatar
Thomas Löffler committed
15
  PHP_EXECUTABLE: "/opt/php/php72/bin/php"
16
  ADDITIONAL_TABLE_EXCLUDES: "-e 'tx_certifications_*' -e 'tx_t3odonation_domain_model_donation' -e 'tx_t3omembership_domain_model_member' -e 'tx_randombanners_domain_model_banner'"
17

18 19 20 21 22 23
stages:
  - maintenance
  - test
  - build
  - layout
  - deploy
24
  - badges
25 26
  - warmup

27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
.deploy-template: &deploy_template
  stage: deploy
  image: composer:1
  before_script:
    - apk add rsync --update
    - mkdir -p /root/.ssh/
    - eval $(ssh-agent -s)
    - echo "$SSH_PRIVATE_KEY_STAGE" | ssh-add -
    - echo "$SSH_PRIVATE_KEY_PRODUCTION" | ssh-add -
    - ssh-keyscan ${STAGE_HOST} >> /root/.ssh/known_hosts
    - ssh-keyscan ${PRODUCTION_HOST} >> /root/.ssh/known_hosts
    - composer config cache-dir /cache/composer
    - composer global require deployer/deployer:6.6.0 --update-with-dependencies
    - composer global require deployer/recipes
  script:
    - /tmp/vendor/bin/dep --file=./.gitlab-ci/deployer/deploy.php deploy -vv ${CI_BUILD_REF_NAME}
  dependencies:
    - layout
  except:
    - assets
47

Thomas Löffler's avatar
Thomas Löffler committed
48
deploy-main:
49 50
  <<: *deploy_template
  environment:
Thomas Löffler's avatar
Thomas Löffler committed
51
    name: main
52 53
    url: https://${PRODUCTION_HOST}
  only:
Thomas Löffler's avatar
Thomas Löffler committed
54
    - main
55 56 57 58 59 60 61 62

deploy-develop:
  <<: *deploy_template
  environment:
    name: develop
    url: https://${STAGE_HOST}
  only:
    - develop
63 64 65 66

"Create Badge":
  stage: badges
  script:
Thomas Löffler's avatar
Thomas Löffler committed
67
    - last_master_deploy=$(git --no-pager log -1 --date=format:"%Y/%m/%d-%T" --format="%ad" origin/main)
68
    - anybadge -l "Last Production Deployment" -v $last_master_deploy -f lastProductionDeployment.svg -c orange