Formatting

main
Bot 6 years ago committed by Igor Scheller
parent b2303c0723
commit bdb653090c

@ -2,8 +2,8 @@ image: php
variables: variables:
DOCKER_DRIVER: overlay2 DOCKER_DRIVER: overlay2
TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME TEST_IMAGE: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}
RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest RELEASE_IMAGE: ${CI_REGISTRY_IMAGE}:latest
MYSQL_DATABASE: engelsystem MYSQL_DATABASE: engelsystem
MYSQL_USER: engel MYSQL_USER: engel
MYSQL_PASSWORD: engelsystem MYSQL_PASSWORD: engelsystem
@ -24,24 +24,24 @@ stages:
tags: tags:
- dind - dind
before_script: before_script:
- docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY" - docker login -u gitlab-ci-token -p "${CI_JOB_TOKEN}" "${CI_REGISTRY}"
build-image: build-image:
<<: *docker_definition <<: *docker_definition
stage: build stage: build
script: script:
- docker build --pull -t "$TEST_IMAGE" -f contrib/Dockerfile . - docker build --pull -t "${TEST_IMAGE}" -f contrib/Dockerfile .
- docker push "$TEST_IMAGE" - docker push "${TEST_IMAGE}"
build-image.nginx: build-image.nginx:
<<: *docker_definition <<: *docker_definition
stage: build stage: build
script: script:
- docker build --pull -t "$TEST_IMAGE.nginx" -f contrib/nginx/Dockerfile . - docker build --pull -t "${TEST_IMAGE}.nginx" -f contrib/nginx/Dockerfile .
- docker push "$TEST_IMAGE.nginx" - docker push "${TEST_IMAGE}.nginx"
test: test:
image: $TEST_IMAGE image: ${TEST_IMAGE}
stage: test stage: test
services: services:
- mariadb:10.2 - mariadb:10.2
@ -53,7 +53,7 @@ test:
- ./coverage/ - ./coverage/
coverage: '/^\s*Lines:\s*(\d+(?:\.\d+)?%)/' coverage: '/^\s*Lines:\s*(\d+(?:\.\d+)?%)/'
before_script: before_script:
- apk add $PHPIZE_DEPS && pecl install xdebug && docker-php-ext-enable xdebug - apk add ${PHPIZE_DEPS} && pecl install xdebug && docker-php-ext-enable xdebug
- curl -sS https://getcomposer.org/installer | php -- --no-ansi --install-dir /usr/local/bin/ --filename composer - curl -sS https://getcomposer.org/installer | php -- --no-ansi --install-dir /usr/local/bin/ --filename composer
- cp -R tests/ phpunit.xml "${DOCROOT}" - cp -R tests/ phpunit.xml "${DOCROOT}"
- HOMEDIR=$(pwd) - HOMEDIR=$(pwd)
@ -68,9 +68,9 @@ release-image:
<<: *docker_definition <<: *docker_definition
stage: release stage: release
script: script:
- docker pull "$TEST_IMAGE" - docker pull "${TEST_IMAGE}"
- docker tag "$TEST_IMAGE" "$RELEASE_IMAGE" - docker tag "${TEST_IMAGE}" "${RELEASE_IMAGE}"
- docker push "$RELEASE_IMAGE" - docker push "${RELEASE_IMAGE}"
only: only:
- master - master
@ -78,15 +78,15 @@ release-image.nginx:
<<: *docker_definition <<: *docker_definition
stage: release stage: release
script: script:
- docker pull "$TEST_IMAGE.nginx" - docker pull "${TEST_IMAGE}.nginx"
- docker tag "$TEST_IMAGE.nginx" "$RELEASE_IMAGE.nginx" - docker tag "${TEST_IMAGE}.nginx" "${RELEASE_IMAGE}.nginx"
- docker push "$RELEASE_IMAGE.nginx" - docker push "${RELEASE_IMAGE}.nginx"
only: only:
- master - master
.deploy_template: &deploy_definition .deploy_template: &deploy_definition
stage: deploy stage: deploy
image: $TEST_IMAGE image: ${TEST_IMAGE}
before_script: before_script:
- apk add bash rsync openssh-client - apk add bash rsync openssh-client
@ -94,7 +94,7 @@ release-image.nginx:
# Configure SSH # Configure SSH
- &deploy_template_script |- - &deploy_template_script |-
mkdir -p ~/.ssh mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" | sed -e 's/\r//g' > ~/.ssh/id_ed25519 echo "${SSH_PRIVATE_KEY}" | sed -e 's/\r//g' > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519
cd "${DOCROOT}" cd "${DOCROOT}"

Loading…
Cancel
Save