From ac798d840f41a719b3cf06f06b7400b3928633f6 Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Thu, 11 Oct 2018 13:30:20 -0400 Subject: [PATCH] Set up Jenkins build --- .gitlab-ci.yml | 31 ------------------------ Jenkinsfile | 53 +++++++++++++++++++++++++++++++++++++++++ build/docker_install.sh | 3 +-- 3 files changed, 54 insertions(+), 33 deletions(-) delete mode 100644 .gitlab-ci.yml create mode 100644 Jenkinsfile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index a7c4f28..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,31 +0,0 @@ -test:7: - before_script: - - sh build/docker_install.sh > /dev/null - - apk add --no-cache php7-phpdbg - - curl -sS https://getcomposer.org/installer | php - - php composer.phar install --ignore-platform-reqs - image: php:7-alpine - script: - - phpdbg -qrr -- vendor/bin/phpunit -c build --coverage-text --colors=never - -test:7.1: - stage: test - before_script: - - sh build/docker_install.sh > /dev/null - - apk add --no-cache php7-phpdbg - - curl -sS https://getcomposer.org/installer | php - - php composer.phar install --ignore-platform-reqs - image: php:7.1-alpine - script: - - phpdbg -qrr -- ./vendor/bin/phpunit -c build --coverage-text --colors=never - -test:7.2: - stage: test - before_script: - - sh build/docker_install.sh > /dev/null - - apk add --no-cache php7-phpdbg - - curl -sS https://getcomposer.org/installer | php - - php composer.phar install --ignore-platform-reqs - image: php:7.2-alpine - script: - - phpdbg -qrr -- ./vendor/bin/phpunit -c build --coverage-text --colors=never \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..f89f207 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,53 @@ +pipeline { + agent none + stages { + stage('PHP 7.0') { + agent { + docker { + image 'php:7-alpine' + args '-u root --privileged' + } + } + steps { + sh 'chmod +x ./build/docker_install.sh' + sh 'sh build/docker_install.sh' + sh 'apk add --no-cache php7-phpdbg' + sh 'curl -sS https://getcomposer.org/installer | php' + sh 'php composer.phar install --ignore-platform-reqs' + sh 'phpdbg -qrr -- ./vendor/bin/phpunit --coverage-text --colors=never' + } + } + stage('PHP 7.1') { + agent { + docker { + image 'php:7.1-alpine' + args '-u root --privileged' + } + } + steps { + sh 'chmod +x ./build/docker_install.sh' + sh 'sh build/docker_install.sh' + sh 'apk add --no-cache php7-phpdbg' + sh 'curl -sS https://getcomposer.org/installer | php' + sh 'php composer.phar install --ignore-platform-reqs' + sh 'phpdbg -qrr -- ./vendor/bin/phpunit --coverage-text --colors=never' + } + } + stage('PHP 7.2') { + agent { + docker { + image 'php:7.2-alpine' + args '-u root --privileged' + } + } + steps { + sh 'chmod +x ./build/docker_install.sh' + sh 'sh build/docker_install.sh' + sh 'apk add --no-cache php7-phpdbg' + sh 'curl -sS https://getcomposer.org/installer | php' + sh 'php composer.phar install --ignore-platform-reqs' + sh 'phpdbg -qrr -- ./vendor/bin/phpunit --coverage-text --colors=never' + } + } + } +} \ No newline at end of file diff --git a/build/docker_install.sh b/build/docker_install.sh index 7ddee01..66bccc5 100644 --- a/build/docker_install.sh +++ b/build/docker_install.sh @@ -6,7 +6,6 @@ set -xe # Install git (the php image doesn't have it) which is required by composer -echo -e 'http://dl-cdn.alpinelinux.org/alpine/edge/main\nhttp://dl-cdn.alpinelinux.org/alpine/edge/community\nhttp://dl-cdn.alpinelinux.org/alpine/edge/testing' > /etc/apk/repositories -apk add --no-cache \ +apk --update add --no-cache \ curl \ git