From c47ad68586749e19fce125da9820d0fd0b2bf575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 26 Oct 2015 20:59:33 +0100 Subject: [PATCH 1/3] add gitlab-ci --- .gitlab-ci.yml | 17 +++++++++++++++++ .../App/app/config/parameters.gitlab-ci.yml | 7 +++++++ 2 files changed, 24 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 Tests/Fixtures/App/app/config/parameters.gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..6a6ef31ee --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,17 @@ +services: + - chill/database:latest + +before_script: + - composer config -g github-oauth.github.com $GITHUB_TOKEN + - composer install --no-interaction + - cp Tests/Fixtures/App/app/config/parameters.gitlab-ci.yml Tests/Fixtures/App/app/config/parameters.yml + - ./console.sh --env=test cache:warmup + - ./console.sh doctrine:migrations:migrate --env=test --no-interaction + - ./console.sh doctrine:fixtures:load --env=test --no-interaction + +test:php-5.6: + stage: test + script: phpunit --testdox +test:php-7: + stage: test + script: phpunit --testdox diff --git a/Tests/Fixtures/App/app/config/parameters.gitlab-ci.yml b/Tests/Fixtures/App/app/config/parameters.gitlab-ci.yml new file mode 100644 index 000000000..01979d64f --- /dev/null +++ b/Tests/Fixtures/App/app/config/parameters.gitlab-ci.yml @@ -0,0 +1,7 @@ +parameters: + database_host: localhost + database_port: 5432 + database_name: postgres + database_user: postgres + database_password: postgres + locale: fr From 7baa7bddc3a1613816c691e454841baa885a5095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 26 Oct 2015 21:13:47 +0100 Subject: [PATCH 2/3] fix auth and database url --- .gitignore | 2 ++ .gitlab-ci.yml | 2 +- Tests/Fixtures/App/app/config/parameters.gitlab-ci.yml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 90d5ec78f..08abe3eac 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,5 @@ bin/* /tmp/* src/Chill/CustomFieldsBundle/vendor/* bootstrap.php.cache +#the file created by composer to store creds +auth.json diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6a6ef31ee..9f2233cb5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ services: - chill/database:latest before_script: - - composer config -g github-oauth.github.com $GITHUB_TOKEN + - composer config github-oauth.github.com $GITHUB_TOKEN - composer install --no-interaction - cp Tests/Fixtures/App/app/config/parameters.gitlab-ci.yml Tests/Fixtures/App/app/config/parameters.yml - ./console.sh --env=test cache:warmup diff --git a/Tests/Fixtures/App/app/config/parameters.gitlab-ci.yml b/Tests/Fixtures/App/app/config/parameters.gitlab-ci.yml index 01979d64f..9e3b75daf 100644 --- a/Tests/Fixtures/App/app/config/parameters.gitlab-ci.yml +++ b/Tests/Fixtures/App/app/config/parameters.gitlab-ci.yml @@ -1,5 +1,5 @@ parameters: - database_host: localhost + database_host: chill__database database_port: 5432 database_name: postgres database_user: postgres From 7a73c0170c7af36e78bbacc16a9a3387ad9169af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 24 Dec 2015 15:16:04 +0100 Subject: [PATCH 3/3] set a composer root version + select image php-7 The composer root version is required to let composer decide on which branch he is, as we have mirrored dependencies (custom field requires person, which requires custom field). The php 7 build select now php 7 image --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9f2233cb5..50a37acc8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,7 @@ services: before_script: - composer config github-oauth.github.com $GITHUB_TOKEN + - if [ $CI_BUILD_REF_NAME = "1.0" ] ; then export COMPOSER_ROOT_VERSION="1.0-dev"; else export COMPOSER_ROOT_VERSION="dev-master"; fi - composer install --no-interaction - cp Tests/Fixtures/App/app/config/parameters.gitlab-ci.yml Tests/Fixtures/App/app/config/parameters.yml - ./console.sh --env=test cache:warmup @@ -14,4 +15,5 @@ test:php-5.6: script: phpunit --testdox test:php-7: stage: test + image: chill/ci-image:php-7 script: phpunit --testdox