Skip to content
This repository was archived by the owner on Feb 19, 2020. It is now read-only.

Conversation

@MaSpeng
Copy link
Contributor

@MaSpeng MaSpeng commented Mar 22, 2018

This patch will add support for creating an phar for each new release.

The intention behind this pull request is to be able to use an phar instead of the composer dependency to fulfill the task of uploading the generated coverage report.

Things that need to be done:

  • To be able to add the created phar during the travis build to the release, an github api access token has to be added to the travis.yml. Please provide me an encrypted github access token so i can update this pull request.

See https://docs.travis-ci.com/user/deployment/releases/ and https://docs.travis-ci.com/user/environment-variables/#Defining-encrypted-variables-in-.travis.yml for further details.

Please let me know if i could provide any further details.

### Added
- support to build phar using `box-project/box2`
- support to provide certificate bundle via temporary file to avoid curl issue when using phar, see (https://bugs.php.net/bug.php?id=69035) for further details
- support to create phar during travis build and attach it to release
@rtfpessoa
Copy link
Contributor

@MaSpeng thanks for your contribution.

The pr looks good, just needs some adjustments. You added this installation alternative in the beginning and since this is an alternative and not the recommended way it should be after the current one.

The other detail is the deploy. Would it be possible to do it in CircleCI? We do not use travis for our builds. In this case we only have it in this project to have an example.

Moved description for alternative installation method at the end of the installation description.
@MaSpeng
Copy link
Contributor Author

MaSpeng commented Mar 22, 2018

@rtfpessoa I updated the readme and moved the instruction at the end of the installation description.

Regarding the upload of the created phar using CircleCi, as far as i could find out it should be possible.
See an small example how it should work: https://gist.github.com/AGmakonts/ef49d60ea09daed210ef47812b9d03b6

Currently i haven't access to CircleCi as an build environment so i am unable to create an test for the required configuration. You might help me with that?

Otherwise i could remove the changes from the travis configuration.

Revertet changes to travis ci configuration and added required deployment changes to CircleCi configuration.
@MaSpeng
Copy link
Contributor Author

MaSpeng commented Mar 22, 2018

@rtfpessoa I reverted the changes to the travis ci configuration and updated the CircleCi configuration to create an phar on creating an new release/tag. It will create the phar and upload it to the github release archive.

If not already done, an environment named GITHUB_TOKEN with an token wich as access to the repository has to be added to the CircleCi project settings.

I have successfully tested it with an free account from CircleCi.

@rtfpessoa
Copy link
Contributor

I just added the key to the CircleCI environment. I will merge this an see if it works.

Can you just add a title before the instructions in the readme like: Alternative Installation (using phar)

Added separate title for alternative installation using phar.
@rtfpessoa rtfpessoa merged commit 30cf045 into archived-codacy:master Mar 22, 2018
@rtfpessoa
Copy link
Contributor

rtfpessoa commented Mar 22, 2018

@MaSpeng I will have to revert this back. I did not completely understand what this plugin does.

We are doing the tags manually and this plugin seems to rely on a tag.

I guess we can export the phar in CircleCI, but in GitHub will be harder since there is no good way to manage major, minor, path releases from the build server.

@MaSpeng
Copy link
Contributor Author

MaSpeng commented Mar 22, 2018

@rtfpessoa The ci configuration will run the deployment commands (creation of the phar and uploading to the github release) only if the build has been triggered by the creation of an tag (manually or automatically is the same) and if the tag follows semver (x.x.x).

The plugin will use the github api to attach the provided file to the provided tag during the build.

For me i used the provided CircleCi configuration with an fork of this repo. After i created an release/tag on github, CircleCi has run a build. As an result i got a version with the attached phar.

See: https://github.com/MaSpeng/php-codacy-coverage/releases/tag/1.4.2.

As i understood there should be no problem because the build, creation of the phar and upload will only be executed after a new tag has been created.

@rtfpessoa
Copy link
Contributor

Ahhh, that makes a lot of sense. I guess I was confused. I think now it should be running.

https://github.com/codacy/php-codacy-coverage/releases/tag/1.4.2

Thanks for your help and patience.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants