hpi-schul-cloud / schulcloud-server

Schulcloud-Verbund-Software-Server
GNU Affero General Public License v3.0
74 stars 17 forks source link

Travis CI "deploy" job fails for PRs from forks #1191

Closed pmeinhardt closed 4 years ago

pmeinhardt commented 4 years ago

It looks a bit like the "deploy" job on Travis CI fails for PRs made from forks of this project.

The error seems to always be the same:

$ openssl aes-256-cbc -K $encrypted_2709882c490b_key -iv $encrypted_2709882c490b_iv -in travis_rsa.enc -out travis_rsa -d

iv undefined

The command "openssl aes-256-cbc -K $encrypted_2709882c490b_key -iv $encrypted_2709882c490b_iv -in travis_rsa.enc -out travis_rsa -d" failed and exited with 1 during .

https://travis-ci.com/github/schul-cloud/schulcloud-server/jobs/321310691#L208-L210

It appears the variables referenced in the .travis.yml and deploy.sh are not defined. These sections in the Travis CI documentation might be relevant?

Defining encrypted variables in .travis.yml

Encrypted environment variables are not available to pull requests from forks due to the security risk of exposing such information to unknown code.

https://docs.travis-ci.com/user/environment-variables#defining-encrypted-variables-in-travisyml

Defining Variables in Repository Settings

By default, the value of these new environment variables is hidden from the export line in the logs. This corresponds to the behavior of encrypted variables in your .travis.yml. The variables are stored encrypted in our systems, and get decrypted when the build script is generated.

https://docs.travis-ci.com/user/environment-variables#defining-variables-in-repository-settings

I am not sure how to best tackle this issue and what the "mode of working" is with regard to contributions from forks, but let me know if I can help troubleshoot. ✌️

tofixx commented 4 years ago

This is not an issue. Forks should not being deployed :)

pmeinhardt commented 4 years ago

This is not an issue. Forks should not being deployed :)

Should the deploy job then just not run for forks?

I think Travis allows running jobs only on certain conditions:

or, as a fallback TRAVIS_REPO_SLUG (https://docs.travis-ci.com/user/environment-variables./#default-environment-variables)