Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change composer installation in docker #128

Merged
merged 8 commits into from
Aug 17, 2020

Conversation

v1v
Copy link
Member

@v1v v1v commented Aug 17, 2020

What

Fixes the current issue when the composer version has changed but the sha512sum not!

[2020-08-17T08:29:42.863Z] Step 4/10 : RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"  && php -r "if (hash_file('sha384', 'composer-setup.php') === 'e5325b19b381bfd88ce90a5ddb7823406b2a38cff6bb704b0acc289a09c8128d4a8ce2bbafcd1fcbdc38666422fe2806') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"  && php composer-setup.php --install-dir=/usr/bin --filename=composer  && php -r "unlink('composer-setup.php');"

[2020-08-17T08:29:42.863Z]  ---> Running in b89db624975c

[2020-08-17T08:29:43.807Z] Installer corrupt

[2020-08-17T08:29:43.807Z] Could not open input file: composer-setup.php

[2020-08-17T08:29:44.068Z] The command '/bin/sh -c php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"  && php -r "if (hash_file('sha384', 'composer-setup.php') === 'e5325b19b381bfd88ce90a5ddb7823406b2a38cff6bb704b0acc289a09c8128d4a8ce2bbafcd1fcbdc38666422fe2806') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"  && php composer-setup.php --install-dir=/usr/bin --filename=composer  && php -r "unlink('composer-setup.php');"' returned a non-zero code: 1

[2020-08-17T08:29:44.068Z] .ci/Makefile:14: recipe for target 'prepare' failed

[2020-08-17T08:29:44.068Z] make: *** [prepare] Error 1

Why

Being reproducible and trust the docker composer image

Further references

See https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md#how-do-i-install-composer-programmatically-

@v1v v1v added automation bug Something isn't working labels Aug 17, 2020
@v1v v1v self-assigned this Aug 17, 2020
@v1v v1v requested review from SergeyKleyman and a team August 17, 2020 09:07
@apmmachine
Copy link
Contributor

apmmachine commented Aug 17, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #128 updated]

  • Start Time: 2020-08-17T13:49:54.626+0000

  • Duration: 15 min 21 sec

Test stats 🧪

Test Results
Failed 0
Passed 108
Skipped 0
Total 108

Cannot find autoconf
@@ -13,8 +13,7 @@ RUN apt-get -qq update \
&& rm -rf /var/lib/apt/lists/*

RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php -r "if (hash_file('sha384', 'composer-setup.php') === 'e5325b19b381bfd88ce90a5ddb7823406b2a38cff6bb704b0acc289a09c8128d4a8ce2bbafcd1fcbdc38666422fe2806') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
&& php composer-setup.php --install-dir=/usr/bin --filename=composer \
&& php composer-setup.php --install-dir=/usr/bin --filename=composer --version=1.10.10 \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being predictable with a specific version of the composer to be installed.

@v1v v1v merged commit 3ae2557 into elastic:master Aug 17, 2020
@v1v v1v deleted the feature/composer-docker branch August 17, 2020 14:14
v1v added a commit to v1v/apm-agent-php that referenced this pull request Aug 18, 2020
* upstream/master:
  Add ENVIRONMENT configuration option
  Change composer installation in docker (elastic#128)
  Add tests/APM_Agents_shared directory
  [packaging] support multiple PHP API (elastic#121)
  [Packaging] restore php.ini if something bad happened (elastic#116)
  [CI] Cosmetic changes in the stage names (elastic#115)
v1v added a commit to v1v/apm-agent-php that referenced this pull request Aug 19, 2020
…utomation-tag-based

* upstream/master:
  Support APK with FPM (elastic#92)
  Add ENVIRONMENT configuration option
  Change composer installation in docker (elastic#128)
  Add tests/APM_Agents_shared directory
@v1v v1v removed the bug Something isn't working label Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants