Commit 27a8c00e authored by Thomas Löffler's avatar Thomas Löffler
Browse files

Move t3o basic pipeline jobs yaml file from t3olayout

parents
include:
- remote: 'https://git.spooner.io/spooner-web/gitlab-anybadge-creator/-/raw/main/anybadges.yml'
variables:
GIT_STRATEGY: "none"
GIT_SSL_NO_VERIFY: "true"
ADDITIONAL_TABLE_EXCLUDES: ""
cache:
key: "$CI_COMMIT_REF_NAME-$CI_JOB_STAGE"
paths:
- vendor/
- private/typo3conf/ext/t3olayout/Build/node_modules/
before_script:
- apk add bash --no-cache
stages:
- maintenance
- test
- build
- layout
- deploy
- badges
test:typoscript:
stage: test
image: composer:1
variables:
GIT_STRATEGY: "clone"
before_script:
- composer global require helmich/typo3-typoscript-lint --update-with-all-dependencies
script:
- /tmp/vendor/bin/typoscript-lint -c typoscript-lint.yml --fail-on-warnings
test:php:
stage: test
image: ekreative/php-cs-fixer:2
variables:
GIT_STRATEGY: "clone"
script:
- php-cs-fixer fix --dry-run --config=.gitlab-ci/build/.php_cs --diff
test:composer:
stage: test
image: composer:1
variables:
GIT_STRATEGY: "clone"
before_script:
- composer global require sensiolabs/security-checker
script:
- /tmp/vendor/bin/security-checker security:check
build:
stage: build
image: composer:1
variables:
GIT_STRATEGY: "clone"
GIT_SUBMODULE_STRATEGY: "recursive"
before_script:
- apk add bash --no-cache
- apk add git --update
- export COMPOSER_CACHE_DIR=/cache/composer
- composer config store-auths false
- composer config http-basic.git-t3o.typo3.org gitlab-ci-token ${CI_BUILD_TOKEN}
script:
- composer config store-auths false
- composer config http-basic.git-t3o.typo3.org gitlab-ci-token ${CI_BUILD_TOKEN}
- composer install --no-dev --ignore-platform-reqs
artifacts:
paths:
- ./
expire_in: '1h'
layout:
stage: layout
image: node:12
before_script:
- cd private/typo3conf/ext/t3olayout/Build
script:
- npm install
- npm run build
after_script:
- rm -Rf private/typo3conf/ext/t3olayout/Build/node_modules
artifacts:
paths:
- ./
expire_in: '4h'
dependencies:
- build
.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
deploy-main:
<<: *deploy_template
environment:
name: main
url: https://${PRODUCTION_HOST}
only:
- main
deploy-develop:
<<: *deploy_template
environment:
name: develop
url: https://${STAGE_HOST}
only:
- develop
.maintenance: &maintenance_template
variables:
GIT_STRATEGY: none
stage: maintenance
when: manual
image:
name: composer:1
entrypoint: ["/bin/sh", "-c"]
before_script:
- apk add rsync --update
- mkdir -p /root/.ssh/
- eval $(ssh-agent -s)
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY_STAGE" | ssh-add -
- ssh-keyscan ${STAGE_HOST} >> /root/.ssh/known_hosts
Get dump for local environment:
<<: *maintenance_template
script:
- mkdir dump
- ssh ${STAGE_USER}@${STAGE_HOST} "php ./ci/current/vendor/bin/typo3cms database:export -c Default -e 'cf_*' -e 'cache_*' -e '[bf]e_sessions' -e '[bf]e_users' -e 'sys_log' -e 'sys_history' -e 'sys_registry' -e 'tx_solr_*' -e 'tx_igldapssoauth_config' ${ADDITIONAL_TABLE_EXCLUDES} | gzip -9 -c" > ./dump/dump.sql.gz
artifacts:
paths:
- ./dump/
expire_in: 1d
"Create Badge":
stage: badges
script:
- last_master_deploy=$(git --no-pager log -1 --date=format:"%Y/%m/%d-%T" --format="%ad" origin/main)
- anybadge -l "Last Production Deployment" -v $last_master_deploy -f lastProductionDeployment.svg -c orange
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment