Class HasEnvironmentVariables<T extends HasEnvironmentVariables>

java.lang.Object
cd.go.contrib.plugins.configrepo.groovy.dsl.Node<T>
cd.go.contrib.plugins.configrepo.groovy.dsl.NamedNode<T>
cd.go.contrib.plugins.configrepo.groovy.dsl.HasEnvironmentVariables<T>
All Implemented Interfaces:
Configurable, KeyVal.Mixin, UtilsMixin
Direct Known Subclasses:
Environment, Job, Pipeline, Stage

public abstract class HasEnvironmentVariables<T extends HasEnvironmentVariables> extends NamedNode<T>
  • Constructor Details

    • HasEnvironmentVariables

      public HasEnvironmentVariables(String name)
    • HasEnvironmentVariables

      public HasEnvironmentVariables()
  • Method Details

    • getEnvironmentVariables

      public Map<String,String> getEnvironmentVariables()
      The list of environment variables associated with this environment.

      /*
       * Copyright 2022 Thoughtworks, Inc.
       *
       * Licensed under the Apache License, Version 2.0 (the "License");
       * you may not use this file except in compliance with the License.
       * You may obtain a copy of the License at
       *
       *     http://www.apache.org/licenses/LICENSE-2.0
       *
       * Unless required by applicable law or agreed to in writing, software
       * distributed under the License is distributed on an "AS IS" BASIS,
       * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       * See the License for the specific language governing permissions and
       * limitations under the License.
       */


        pipeline('build') {
          environmentVariables = [
            SSH_HOST: 'deploy.example.com',
            SSH_USER: 'deploy-user'
          ]
        }

      See Also:
      • secureEnvironmentVariables
    • getSecureEnvironmentVariables

      public Map<String,String> getSecureEnvironmentVariables()
      The list of secure(encrypted) environment variables associated with this environment.

      /*
       * Copyright 2022 Thoughtworks, Inc.
       *
       * Licensed under the Apache License, Version 2.0 (the "License");
       * you may not use this file except in compliance with the License.
       * You may obtain a copy of the License at
       *
       *     http://www.apache.org/licenses/LICENSE-2.0
       *
       * Unless required by applicable law or agreed to in writing, software
       * distributed under the License is distributed on an "AS IS" BASIS,
       * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       * See the License for the specific language governing permissions and
       * limitations under the License.
       */


        pipeline('build') {
          secureEnvironmentVariables = [
            SSH_PASSWORD: 'AES:yBk975e1rJiuRnAx9AZ6Og==:ee6yi/2sEh5/TUlbmNWelg==',
            API_TOKEN   : 'AES:mYCdWAx/pR0YKLpSJHF9ZQ==:zbSkQLjsL34pzXDtyTj0iw=='
          ]
        }

      See Also:
    • setEnvironmentVariables

      public void setEnvironmentVariables(Map<String,String> environmentVariables)
      The list of environment variables associated with this environment.

      /*
       * Copyright 2022 Thoughtworks, Inc.
       *
       * Licensed under the Apache License, Version 2.0 (the "License");
       * you may not use this file except in compliance with the License.
       * You may obtain a copy of the License at
       *
       *     http://www.apache.org/licenses/LICENSE-2.0
       *
       * Unless required by applicable law or agreed to in writing, software
       * distributed under the License is distributed on an "AS IS" BASIS,
       * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       * See the License for the specific language governing permissions and
       * limitations under the License.
       */


        pipeline('build') {
          environmentVariables = [
            SSH_HOST: 'deploy.example.com',
            SSH_USER: 'deploy-user'
          ]
        }

      See Also:
      • secureEnvironmentVariables
    • setSecureEnvironmentVariables

      public void setSecureEnvironmentVariables(Map<String,String> secureEnvironmentVariables)
      The list of secure(encrypted) environment variables associated with this environment.

      /*
       * Copyright 2022 Thoughtworks, Inc.
       *
       * Licensed under the Apache License, Version 2.0 (the "License");
       * you may not use this file except in compliance with the License.
       * You may obtain a copy of the License at
       *
       *     http://www.apache.org/licenses/LICENSE-2.0
       *
       * Unless required by applicable law or agreed to in writing, software
       * distributed under the License is distributed on an "AS IS" BASIS,
       * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       * See the License for the specific language governing permissions and
       * limitations under the License.
       */


        pipeline('build') {
          secureEnvironmentVariables = [
            SSH_PASSWORD: 'AES:yBk975e1rJiuRnAx9AZ6Og==:ee6yi/2sEh5/TUlbmNWelg==',
            API_TOKEN   : 'AES:mYCdWAx/pR0YKLpSJHF9ZQ==:zbSkQLjsL34pzXDtyTj0iw=='
          ]
        }

      See Also:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class NamedNode<T extends HasEnvironmentVariables>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class NamedNode<T extends HasEnvironmentVariables>
    • toString

      public String toString()
      Overrides:
      toString in class NamedNode<T extends HasEnvironmentVariables>