Shippable / support

Shippable SaaS customers can report issues and feature requests in this repository
101 stars 28 forks source link

environment variables from integration #4928

Open magwas opened 5 years ago

magwas commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

magwas commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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.