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

environment variables from integration #4928

Open
magwas opened this issue Sep 2, 2019 · 5 comments
Open

environment variables from integration #4928

magwas opened this issue Sep 2, 2019 · 5 comments

Comments

@magwas
Copy link

magwas commented Sep 2, 2019

Description of your issue:

I try to use a key-value pair integration in my job. The keys I define is 'sonarkey' and 'issuetoken'.
I want these keys to show up as environment variables.
I have added the integration to my shippable.yml, but these keys do not show up as environment variables. What do I miss?
Here is my shippable.yml:

build_image: kodekonveyor/toolchain:master
integrations:
  generic:
    - integrationName: kkpipeline


build:
  cache: true
  cache_dir_list:
    - ~/.m2
  ci:
    - set |sed 's/[0-9]/X/g'
    - /usr/local/toolchain/tools/Script
  on_success:
    - /usr/local/toolchain/tools/publish
  on_failure:
    - /usr/local/toolchain/tools/publish

A console log is here: https://app.shippable.com/github/edemo/PDEngine/runs/972/1/console

@a-murphy
Copy link

a-murphy commented Sep 2, 2019

Key-value pair integrations were added for Assembly Lines, and all projects enabled for CI since March 2017 have automatically been part of an Assembly Line, even if they aren't connected to anything else.

Since you have an older project that does not appear to be part of an Assembly Line, could you try clicking the "hook" button on the project settings page? That will create a runCI job for the project and then it will run as part of an Assembly Line. Let us know if it still isn't finding the integration.

@magwas
Copy link
Author

magwas commented Sep 14, 2019

It seems the issue is still there after pushing that hook button.
https://app.shippable.com/github/edemo/PDEngine/runs/973/1/console

@magwas
Copy link
Author

magwas commented Sep 14, 2019

Tried to disable and reenable the project in shippable issuetoken is still missing:
https://app.shippable.com/github/edemo/PDEngine/runs/975/1/console

@a-murphy
Copy link

Sorry, I had missed that this was also a pull request to a public repository from a fork. We don't include the variables from key-value integrations in pull request builds that have been opened from a fork of a public repository for security reasons. Anyone can open a pull request to a public repository that modifies the script. You should, however, be able to use the variables in pull requests that are opened from one branch in the repository to another in the same repository and in commit builds. If you need to skip some commands for pull request builds, an example of how to use an if condition to check if the current build is a pull request is available in the environment variables documentation.

@magwas
Copy link
Author

magwas commented Sep 18, 2019

Is it possible to build the pull request using the integrations provided by the issuer of the pull request?
That seems to me like a good solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants