summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Cafferata <jeffrey@jcid.nl>2016-05-29 22:15:56 +0200
committerRémy Coutable <remy@rymai.me>2017-01-26 17:25:30 +0100
commit11551de5fa245323798f4ff40a322a5d003421ec (patch)
treebc88a05fe985f98c1712472eff388db3af0736a1
parent73c54366e64b6c4fc9b652fea6fa1911c19d8316 (diff)
downloadgitlab-ce-improve-ci-example-php-doc.tar.gz
Changed composer installer script in the CI PHP example docimprove-ci-example-php-doc
The script will check some php.ini settings warn you if they are set incorrectly, and then download the latest composer.phar in the current directory. These lines will, in order: - Download the installer SHA-384 to the current directory - Download the installer to the current directory - Verify the installer SHA-384 which you can also cross-check https://composer.github.io/pubkeys.html - Run the installer - Remove the installer & the installer SHA-384 Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r--changelogs/unreleased/improve-ci-example-php-doc.yml4
-rw-r--r--doc/ci/examples/php.md6
2 files changed, 9 insertions, 1 deletions
diff --git a/changelogs/unreleased/improve-ci-example-php-doc.yml b/changelogs/unreleased/improve-ci-example-php-doc.yml
new file mode 100644
index 00000000000..39a85e3d261
--- /dev/null
+++ b/changelogs/unreleased/improve-ci-example-php-doc.yml
@@ -0,0 +1,4 @@
+---
+title: Changed composer installer script in the CI PHP example doc
+merge_request: 4342
+author: Jeffrey Cafferata
diff --git a/doc/ci/examples/php.md b/doc/ci/examples/php.md
index 82ffb841729..5eeec92d976 100644
--- a/doc/ci/examples/php.md
+++ b/doc/ci/examples/php.md
@@ -235,7 +235,11 @@ cache:
before_script:
# Install composer dependencies
-- curl --silent --show-error https://getcomposer.org/installer | php
+- wget https://composer.github.io/installer.sig -O - -q | tr -d '\n' > installer.sig
+- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
+- php -r "if (hash_file('SHA384', 'composer-setup.php') === file_get_contents('installer.sig')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
+- php composer-setup.php
+- php -r "unlink('composer-setup.php'); unlink('installer.sig');"
- php composer.phar install
...