Skip to content

Instantly share code, notes, and snippets.

@pepijnblom
Last active January 24, 2020 08:29
Show Gist options
  • Save pepijnblom/7c24a99e1c30d4cb4c051cd8b93ca859 to your computer and use it in GitHub Desktop.
Save pepijnblom/7c24a99e1c30d4cb4c051cd8b93ca859 to your computer and use it in GitHub Desktop.
magento2-kubernetes-blog-example-gitlab-ci
install:
stage: install
services:
- mariadb:10.2
- redis
variables:
DB_HOST: "127.0.0.1"
DB_NAME: "magento"
DB_USER: "root"
DB_PASSWORD: $CI_JOB_TOKEN
MYSQL_ROOT_PASSWORD: $CI_JOB_TOKEN
MYSQL_DATABASE: $DB_NAME
REDIS_CACHE_HOST: $DB_HOST
REDIS_CACHE_PORT: "6379"
only:
- develop
- tags
# We need to wait 20s because of a bug in K8S runner that does not have a readiness check
before_script:
- sleep 20
script:
- git clone https://gitlab-ci-token:$CI_JOB_TOKEN@git.gracious.nl/magento2/staging-sql.git /tmp/staging
- mysql --user=$DB_USER --password="$DB_PASSWORD" --host=127.0.0.1 $DB_NAME < /tmp/staging/$DB_STAGING
- composer install --prefer-dist --optimize-autoloader --ansi --no-dev --no-suggest --no-interaction
- composer install --prefer-dist --optimize-autoloader --ansi --no-dev --no-suggest --no-interaction -d update
- bin/magento setup:upgrade --no-interaction
- bin/magento setup:di:compile --no-interaction
- composer dump --optimize --no-interaction --no-dev
- bin/magento setup:static-content:deploy en_US nl_NL de_DE --exclude-theme Magento/luma --jobs 6
artifacts:
expire_in: 20 minutes
untracked: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment