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

Add possibilities to read environment from trusted properties file

    • Declarative - 1.2

      Using something like readTrusted to get some properties from a file into the environment.

          [JENKINS-41759] Add possibilities to read environment from trusted properties file

          Code changed in jenkins
          User: rsandell
          Path:
          pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/Credentials.java
          pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy
          pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/CredentialsScript.groovy
          http://jenkins-ci.org/commit/pipeline-model-definition-plugin/d460eaf6442075e0a3189c348e1c2d177116eec8
          Log:
          JENKINS-41759 Fixing failing credentials tests after refactor

          Some other tests are still failing...

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/Credentials.java pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/CredentialsScript.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/d460eaf6442075e0a3189c348e1c2d177116eec8 Log: JENKINS-41759 Fixing failing credentials tests after refactor Some other tests are still failing...

          Code changed in jenkins
          User: rsandell
          Path:
          pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/PropertiesToMapTranslator.groovy
          http://jenkins-ci.org/commit/pipeline-model-definition-plugin/73ecf2531ce7af560933803b7c41cf351d1476b6
          Log:
          JENKINS-41759 Fixed another regression caused by refactoring

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/PropertiesToMapTranslator.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/73ecf2531ce7af560933803b7c41cf351d1476b6 Log: JENKINS-41759 Fixed another regression caused by refactoring

          Code changed in jenkins
          User: rsandell
          Path:
          pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/TrustedProperties.java
          pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/TrustedPropertiesScript.groovy
          pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/TrustedPropertiesTest.java
          pipeline-model-definition/src/test/resources/environmentFromProperties.groovy
          http://jenkins-ci.org/commit/pipeline-model-definition-plugin/dab2511da72839711128709cba20234d09b272de
          Log:
          JENKINS-41759 Read properties file into environment

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/TrustedProperties.java pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/TrustedPropertiesScript.groovy pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/TrustedPropertiesTest.java pipeline-model-definition/src/test/resources/environmentFromProperties.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/dab2511da72839711128709cba20234d09b272de Log: JENKINS-41759 Read properties file into environment

          Code changed in jenkins
          User: rsandell
          Path:
          pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Root.groovy
          pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Stage.groovy
          pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy
          http://jenkins-ci.org/commit/pipeline-model-definition-plugin/998bad3a048f07750a05efdddd3ead986e3e24c5
          Log:
          JENKINS-41759 Moved getEnvVars into CPS context

          So we can call steps without barfing

          Compare: https://github.com/jenkinsci/pipeline-model-definition-plugin/compare/5ad414e35a11...998bad3a048f

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Root.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Stage.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/998bad3a048f07750a05efdddd3ead986e3e24c5 Log: JENKINS-41759 Moved getEnvVars into CPS context So we can call steps without barfing Compare: https://github.com/jenkinsci/pipeline-model-definition-plugin/compare/5ad414e35a11...998bad3a048f

          Code changed in jenkins
          User: rsandell
          Path:
          pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/Utils.groovy
          pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/TrustedProperties.java
          pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/PropertiesToMapTranslator.groovy
          pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/UtilsTest.java
          pipeline-model-definition/src/test/resources/environmentFromProperties.groovy
          http://jenkins-ci.org/commit/pipeline-model-definition-plugin/8609c0f6416602aa24a2cf7d764abc003e74b096
          Log:
          JENKINS-41759 Pick specific describables when choosing env method

          Utilizing the new function in Utils to find an UninstantiatedDescribable
          of a specific type enables us to call the function plain 'properties'

          Compare: https://github.com/jenkinsci/pipeline-model-definition-plugin/compare/d0a70cae74a5^...8609c0f64166

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/Utils.groovy pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/TrustedProperties.java pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/PropertiesToMapTranslator.groovy pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/UtilsTest.java pipeline-model-definition/src/test/resources/environmentFromProperties.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/8609c0f6416602aa24a2cf7d764abc003e74b096 Log: JENKINS-41759 Pick specific describables when choosing env method Utilizing the new function in Utils to find an UninstantiatedDescribable of a specific type enables us to call the function plain 'properties' Compare: https://github.com/jenkinsci/pipeline-model-definition-plugin/compare/d0a70cae74a5 ^...8609c0f64166

          Code changed in jenkins
          User: rsandell
          Path:
          pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Stage.groovy
          pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/environment/DeclarativeEnvironmentContributorDescriptor.java
          http://jenkins-ci.org/commit/pipeline-model-definition-plugin/ffba650da5e31c875151c9059cc7b0c1295cd10f
          Log:
          JENKINS-41759 Cleaned up unused imports and a class javadoc

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Stage.groovy pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/environment/DeclarativeEnvironmentContributorDescriptor.java http://jenkins-ci.org/commit/pipeline-model-definition-plugin/ffba650da5e31c875151c9059cc7b0c1295cd10f Log: JENKINS-41759 Cleaned up unused imports and a class javadoc

          Code changed in jenkins
          User: rsandell
          Path:
          pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/TrustedPropertiesScript.groovy
          pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/TrustedPropertiesTest.java
          pipeline-model-definition/src/test/resources/environmentFromPropertiesEmptyPrefix.groovy
          http://jenkins-ci.org/commit/pipeline-model-definition-plugin/fc740399ec0e43aeef536726c7f623f950b89dc0
          Log:
          JENKINS-41759 Provide posibility of having no prefix

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/TrustedPropertiesScript.groovy pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/TrustedPropertiesTest.java pipeline-model-definition/src/test/resources/environmentFromPropertiesEmptyPrefix.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/fc740399ec0e43aeef536726c7f623f950b89dc0 Log: JENKINS-41759 Provide posibility of having no prefix

          Code changed in jenkins
          User: rsandell
          Path:
          pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/TrustedProperties.java
          pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/TrustedPropertiesScript.groovy
          pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/TrustedPropertiesTest.java
          pipeline-model-definition/src/test/resources/environmentFromProperties.groovy
          pipeline-model-definition/src/test/resources/environmentFromPropertiesEmptyPrefix.groovy
          pipeline-model-definition/src/test/resources/properties/environmentFromCodedMap.groovy
          pipeline-model-definition/src/test/resources/properties/environmentFromLibraryResource.groovy
          pipeline-model-definition/src/test/resources/properties/environmentFromLibraryResourceUrl.groovy
          pipeline-model-definition/src/test/resources/properties/environmentFromProperties.groovy
          pipeline-model-definition/src/test/resources/properties/environmentFromPropertiesEmptyPrefix.groovy
          pipeline-model-definition/src/test/resources/properties/environmentFromSCM.groovy
          http://jenkins-ci.org/commit/pipeline-model-definition-plugin/5d787780a48b9996dd72dac8bcad783aedc274ff
          Log:
          JENKINS-41759 PoC for reading from more places than the trusted scm branch

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/TrustedProperties.java pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/TrustedPropertiesScript.groovy pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/environment/impl/TrustedPropertiesTest.java pipeline-model-definition/src/test/resources/environmentFromProperties.groovy pipeline-model-definition/src/test/resources/environmentFromPropertiesEmptyPrefix.groovy pipeline-model-definition/src/test/resources/properties/environmentFromCodedMap.groovy pipeline-model-definition/src/test/resources/properties/environmentFromLibraryResource.groovy pipeline-model-definition/src/test/resources/properties/environmentFromLibraryResourceUrl.groovy pipeline-model-definition/src/test/resources/properties/environmentFromProperties.groovy pipeline-model-definition/src/test/resources/properties/environmentFromPropertiesEmptyPrefix.groovy pipeline-model-definition/src/test/resources/properties/environmentFromSCM.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/5d787780a48b9996dd72dac8bcad783aedc274ff Log: JENKINS-41759 PoC for reading from more places than the trusted scm branch

          rsandell This is a neat feature, did it ever get integrated?

          Michael Fowler added a comment - rsandell This is a neat feature, did it ever get integrated?

          Liam Newman added a comment -

          mdkf No, the code was never merged.  See the linked PR for details. 

           

          Liam Newman added a comment - mdkf No, the code was never merged.  See the linked PR for details.   

            Unassigned Unassigned
            rsandell rsandell
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: