All Implemented Interfaces:
Configurable, KeyVal.Mixin, UtilsMixin, Iterable<AbstractArtifact>, Collection<AbstractArtifact>, List<AbstractArtifact>

public class Artifacts extends CollectionNode<AbstractArtifact>
Represents a list of artifacts.

/*
 * 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.
 */


  job('build') {
    artifacts {
      build {
        source = 'target/jcoverage'
        destination = 'Jcoverage'
      }
      test {
        source = 'target/reports/junit/**/*.xml'
        destination = 'junit-xml'
      }
      external {
        id = 'docker-release-candidate'
        storeId = 'dockerhub'
        configuration = [
          image: 'gocd/gocd-server',
          tag  : 'latest'
        ]
        secureConfiguration = [
          DB_PASSWORD: 'AES:yBk975e1rJiuRnAx9AZ6Og==:ee6yi/2sEh5/TUlbmNWelg=='
        ]
      }
    }
  }

See Also:
  • Constructor Details

    • Artifacts

      public Artifacts()
  • Method Details

    • build

      Create a build artifact

      /*
       * 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.
       */


        job('build') {
          artifacts {
            build {
              source = 'target/jcoverage'
              destination = 'Jcoverage'
            }
            build {
              source = 'target/dist/**/*.exe'
              destination = 'windows-installers'
            }
          }
        }

      See Also:
    • test

      Create a test artifact

      /*
       * 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.
       */


        job('build') {
          artifacts {
            test {
              source = 'target/reports/junit/**/*.xml'
              destination = 'junit-xml'
            }
          }
        }

      See Also:
    • external

      Create a plugin artifact

      /*
       * 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.
       */


        job('build') {
          artifacts {
            external {
              id = 'docker-release-candidate'
              storeId = 'dockerhub'
              configuration = [
                image: 'gocd/gocd-server',
                tag  : 'latest'
              ]
              secureConfiguration = [
                DB_PASSWORD: 'AES:yBk975e1rJiuRnAx9AZ6Og==:ee6yi/2sEh5/TUlbmNWelg=='
              ]
            }
          }
        }

      See Also:
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Collection<AbstractArtifact>
      Specified by:
      equals in interface List<AbstractArtifact>
      Overrides:
      equals in class CollectionNode<AbstractArtifact>
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Collection<AbstractArtifact>
      Specified by:
      hashCode in interface List<AbstractArtifact>
      Overrides:
      hashCode in class CollectionNode<AbstractArtifact>