Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-7828

sharing of sauce username and api key

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Component/s: sauce-ondemand-plugin
    • Labels:
      None
    • Similar Issues:
      Show 5 results

      Description

      Currently it appears I need to put the sauce username and api key in two places. First in the hudson config so the ssh tunneling works, and then second ~/.sauce-ondemand so the Sauce OnDemand driver for SeleniumFactory knows what it is.

      It seems better if the hudson config could pick it up automatically from ~/.sauce-ondemand, or if was passed through to the hudson project with environment variables. Perhaps one of these things already works, but I didn't see it in the documentation.

        Attachments

          Activity

          Hide
          abayer Andrew Bayer added a comment -

          I think having an option to override with values from environment variables may work, but there are use cases (such as my employer's) where we need to be able to specify the username/api key in Hudson, so I'd argue strongly against only allowing them to come from an environment variable. I'd also argue against picking them up from ~/.sauce-ondemand - that won't work if the file's not there on the master, such as if the tests are all being run on slaves, etc.

          Show
          abayer Andrew Bayer added a comment - I think having an option to override with values from environment variables may work, but there are use cases (such as my employer's) where we need to be able to specify the username/api key in Hudson, so I'd argue strongly against only allowing them to come from an environment variable. I'd also argue against picking them up from ~/.sauce-ondemand - that won't work if the file's not there on the master, such as if the tests are all being run on slaves, etc.
          Hide
          scytacki scytacki added a comment -

          To be more clear, I'm not suggesting that the global username/api key settings in Hudson come from environment variables. Rather that the values set in sauce ondemand section of /hudson/configure are provided by hudson to jobs as environment variables. This way scripts/tasks run in these jobs can figure out these values without having to specify them again.

          Show
          scytacki scytacki added a comment - To be more clear, I'm not suggesting that the global username/api key settings in Hudson come from environment variables. Rather that the values set in sauce ondemand section of /hudson/configure are provided by hudson to jobs as environment variables. This way scripts/tasks run in these jobs can figure out these values without having to specify them again.
          Hide
          lacostej lacostej added a comment -

          If I understand you well, you want hudson to expose its sauceondemand settings as environment variables and the sauce ondemand selenium driver to pick them from the environment.

          Assuming this is done (as part of this issue), according to my reading of the source code, you will have to either

          to override the username and access key come from a value coming from the environment. (see SeleniumFactory.js line 116 )

          Show
          lacostej lacostej added a comment - If I understand you well, you want hudson to expose its sauceondemand settings as environment variables and the sauce ondemand selenium driver to pick them from the environment. Assuming this is done (as part of this issue), according to my reading of the source code, you will have to either pass the SeleniumFactory a parametrized URL, e.g. with export SELENIUM_DRIVER=.....&username=$(SAUCEONDEMAND_USER)&access-key=$(SAUCEONDEMAND_KEY) or modify com/saucelabs/sauce_ondemand/driver/SauceOnDemandSPIImpl.js line ~ 71 ( http://selenium-client-factory.infradna.com/sorcerer/index.html ) to override the username and access key come from a value coming from the environment. (see SeleniumFactory.js line 116 )
          Hide
          rossrowe Ross Rowe added a comment -

          Hi, I'm making some improvements to the configuration UI of the Sauce plugin, and one of the things I'm implementing is the ability to override the user name/access key at the job level.

          Will this provide the functionality that you require?

          Cheers,

          Ross

          Show
          rossrowe Ross Rowe added a comment - Hi, I'm making some improvements to the configuration UI of the Sauce plugin, and one of the things I'm implementing is the ability to override the user name/access key at the job level. Will this provide the functionality that you require? Cheers, Ross
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Ross Rowe
          Path:
          src/main/java/hudson/plugins/sauce_ondemand/PluginImpl.java
          src/main/java/hudson/plugins/sauce_ondemand/SauceOnDemandBuildWrapper.java
          src/main/resources/hudson/plugins/sauce_ondemand/PluginImpl/config.jelly
          http://jenkins-ci.org/commit/sauce-ondemand-plugin/313e7156a5be90f28d6849b0ae18862a33249031
          Log:
          JENKINS-7828 Added ability to use authentication information in ~/.sauce-ondemand file

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ross Rowe Path: src/main/java/hudson/plugins/sauce_ondemand/PluginImpl.java src/main/java/hudson/plugins/sauce_ondemand/SauceOnDemandBuildWrapper.java src/main/resources/hudson/plugins/sauce_ondemand/PluginImpl/config.jelly http://jenkins-ci.org/commit/sauce-ondemand-plugin/313e7156a5be90f28d6849b0ae18862a33249031 Log: JENKINS-7828 Added ability to use authentication information in ~/.sauce-ondemand file
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Ross Rowe
          Path:
          src/test/java/hudson/plugins/sauce_ondemand/PluginImplTest.java
          http://jenkins-ci.org/commit/sauce-ondemand-plugin/7216b8ffcbfc2348b60533d268b47db10d3e7641
          Log:
          JENKINS-7828 Added ability to use authentication information in ~/.sauce-ondemand file

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ross Rowe Path: src/test/java/hudson/plugins/sauce_ondemand/PluginImplTest.java http://jenkins-ci.org/commit/sauce-ondemand-plugin/7216b8ffcbfc2348b60533d268b47db10d3e7641 Log: JENKINS-7828 Added ability to use authentication information in ~/.sauce-ondemand file
          Hide
          rossrowe Ross Rowe added a comment -

          I have added an option in the Admin interface to select whether to use the authentication details in the ~/.sauce-ondemand file, please let me know if you have any further issues.

          Show
          rossrowe Ross Rowe added a comment - I have added an option in the Admin interface to select whether to use the authentication details in the ~/.sauce-ondemand file, please let me know if you have any further issues.

            People

            • Assignee:
              rossrowe Ross Rowe
              Reporter:
              scytacki scytacki
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: