Skip to content
Snippets Groups Projects
Commit 05efb997 authored by a.croix's avatar a.croix
Browse files

Change .gitlab-ci file and remove deploy step (used only for test)

parent f100b3ac
No related branches found
No related tags found
No related merge requests found
Pipeline #6442 passed
stages:
- test
- build
- deploy
## Cache composer packages between all jobs and all branches
## of this project...
......@@ -13,24 +12,24 @@ cache:
before_script:
- cp env.gitlab-ci .env
- touch storage/app/db.sqlite
- COMPOSER_CACHE_DIR=composer-cache composer install --ignore-platform-reqs
- COMPOSER_CACHE_DIR=composer-cache composer install
- php artisan key:generate
- php artisan migrate
# Test with PHP7.4
test:php74:
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/cylab/php74:latest
image: cylab/php74
stage: test
script:
#- vendor/bin/phpunit --coverage-text --colors=never --coverage-html build/coverage
- vendor/bin/phpcs
artifacts:
paths:
- build/
- build/
expire_in: 1 month
build:
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:19.03.1
image: docker:19.03.1
stage: build
tags:
- dind
......@@ -43,29 +42,11 @@ build:
script:
- docker build -t cylab/ctf .
build:release:
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:19.03.1
stage: build
tags:
- dind
services:
- docker:19.03.1-dind
variables:
DOCKER_TLS_CERTDIR: "/certs"
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
before_script:
- docker info
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t gitlab.cylab.be:8081/cylab/mark-web:$CI_COMMIT_REF_SLUG .
- docker tag gitlab.cylab.be:8081/cylab/mark-web:$CI_COMMIT_REF_SLUG gitlab.cylab.be:8081/cylab/mark-web:latest
- docker push gitlab.cylab.be:8081/cylab/mark-web:$CI_COMMIT_REF_SLUG
- docker push gitlab.cylab.be:8081/cylab/mark-web:latest
build:tagged:
only:
- tags
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:19.03.1
image: docker:19.03.1
stage: build
tags:
- dind
......@@ -81,15 +62,3 @@ build:tagged:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- docker push cylab/mark-web:$CI_COMMIT_TAG
- docker push cylab/mark-web:latest
deploy:
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/cylab/php74
stage: deploy
script:
# import ssh private key
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
# in cylab/php72, envoy is already installed...
- ~/.composer/vendor/bin/envoy run deploy --commit="$CI_COMMIT_SHA"
stages:
- test
- build
- deploy
## Cache composer packages between all jobs and all branches
## of this project...
......@@ -12,24 +13,24 @@ cache:
before_script:
- cp env.gitlab-ci .env
- touch storage/app/db.sqlite
- COMPOSER_CACHE_DIR=composer-cache composer install
- COMPOSER_CACHE_DIR=composer-cache composer install --ignore-platform-reqs
- php artisan key:generate
- php artisan migrate
# Test with PHP7.4
test:php74:
image: cylab/php74
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/cylab/php74:latest
stage: test
script:
#- vendor/bin/phpunit --coverage-text --colors=never --coverage-html build/coverage
- vendor/bin/phpcs
artifacts:
paths:
- build/
- build/
expire_in: 1 month
build:
image: docker:19.03.1
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:19.03.1
stage: build
tags:
- dind
......@@ -42,11 +43,29 @@ build:
script:
- docker build -t cylab/ctf .
build:release:
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:19.03.1
stage: build
tags:
- dind
services:
- docker:19.03.1-dind
variables:
DOCKER_TLS_CERTDIR: "/certs"
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
before_script:
- docker info
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t gitlab.cylab.be:8081/cylab/mark-web:$CI_COMMIT_REF_SLUG .
- docker tag gitlab.cylab.be:8081/cylab/mark-web:$CI_COMMIT_REF_SLUG gitlab.cylab.be:8081/cylab/mark-web:latest
- docker push gitlab.cylab.be:8081/cylab/mark-web:$CI_COMMIT_REF_SLUG
- docker push gitlab.cylab.be:8081/cylab/mark-web:latest
build:tagged:
only:
- tags
image: docker:19.03.1
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:19.03.1
stage: build
tags:
- dind
......@@ -62,3 +81,15 @@ build:tagged:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- docker push cylab/mark-web:$CI_COMMIT_TAG
- docker push cylab/mark-web:latest
deploy:
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/cylab/php74
stage: deploy
script:
# import ssh private key
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
# in cylab/php72, envoy is already installed...
- ~/.composer/vendor/bin/envoy run deploy --commit="$CI_COMMIT_SHA"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment