# ============LICENSE_START======================================================= # Copyright (C) 2019 Nordix Foundation. # ================================================================================ # 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. # # SPDX-License-Identifier: Apache-2.0 # ============LICENSE_END========================================================= #------------------------------------------------------------------------------- # Macros are used to avoid hitting parameter expansion of curly brackets and # the need to using include-raw-escape #------------------------------------------------------------------------------- --- # Parameters used for setting multiple Gerrit Projects on Nordix # Required for cases where source repositories depend on each other to build # e.g. sdc-customization depends on sdc repo - parameter: name: multi-project-parameters parameters: - string: name: PROJECTS default: '{projects}' description: JJB configured PROJECTS parameter to identify Nordix Gerrit projects - string: name: BRANCHES default: '{branches}' description: "JJB configured BRANCHES parameter (e.g. 20.1, master)" - string: name: PROJECT_DIRECTORIES default: '{project_directories}' description: Directory names to place PROJECTS - string: name: PROJECT_VERSIONS default: '{project_versions}' description: Commit ids of PROJECTS source to checkout e.g. 6d3ab, d96ba Allows for building from specific versions of a source or can also be left blank to pull latest source. - parameter: name: git-parameters parameters: - string: name: GIT_BASE_HTTPS default: https://gerrit.nordix.org/ description: Base HTTPS URL of repository to clone from - parameter: name: maven-parameters parameters: - string: name: MVN_VERSION default: 3.6.0 description: Maven version to build with - string: name: MVN_URL default: https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/$MVN_VERSION/apache-maven-$MVN_VERSION-bin.zip description: Download URL for Maven - string: name: MVN default: $WORKSPACE/apache-maven-$MVN_VERSION/bin/mvn description: Path to mvn executable - string: name: MVN_PARAMS default: '{mvn_params}' description: Maven build parameters - string: name: MVN_SETTINGS_XML_VERSION default: '{mvn_settings_xml_version}' description: Commit ID of ONAP Oparent repository (https://git.onap.org/oparent/) to pull. Used for Maven settings file. Can be left blank to pull the latest version. - parameter: name: artifactory-parameters parameters: - string: name: ARTIFACTORY_URL default: "https://artifactory.nordix.org/artifactory" description: Artifactory URL to push to # Parameters for source repository artifacts - parameter: name: repo-archive-parameters parameters: - string: name: POM_LOCATION default: '{pom_location}' description: Path to repository pom.xml parsed for version number used within archive filenames - string: name: GREP_PARAMS default: '{grep_parameters}' description: Parameters for grep command used for parsing pom file for version number used within archive filenames - string: name: ARCHIVENAME default: '{archive_name}' description: Name to be given to archive holding the repositories pushed to Artifactory - string: name: ARTIFACTORY_REPO_ARCHIVE_PATH default: '{artifactory_repo_archive_path}' description: Artifactory repository and path to push repository archive to - string: name: REPO_ARCHIVE_ARTIFACT_DIRECTORY default: '{repo_archive_artifact_directory}' description: Workspace directory to hold repository artifacts # Parameters regarding docker image artifacts - parameter: name: docker-archive-parameters parameters: - text: name: DOCKER_IMAGES default: '{docker_images}' description: Docker image names to archive and push to Artifactory - string: name: ARTIFACTORY_DOCKER_IMAGES_PATH default: '{artifactory_docker_images_path}' description: Artifactory repository and path to push docker images to - string: name: DOCKER_IMAGE_ARTIFACT_DIRECTORY default: '{docker_image_artifact_directory}' description: Workspace directory to hold docker image artifacts # Parameters regarding file artifacts (.war, .jar files etc) - parameter: name: artifact_parameters parameters: - text: name: ARTIFACT_PATHS default: '{artifact_paths}' description: Artifact file paths that should be pushed to Artifactory, can contain wildcards e.g. PROJECTDIRECTORY/some/path/catalog-be-*.war - string: name: ARTIFACTORY_ARTIFACT_PATH default: '{artifactory_artifact_path}' description: Artifactory repository and path to push artifacts to e.g. .war .jar files - string: name: ARTIFACT_DIRECTORY default: '{artifact_directory}' description: Workspace directory to hold artifacts # Builders for maven builds - builder: name: 'generate-build-metadata' builders: - shell: !include-raw: ./scripts/generate-build-metadata.sh - builder: name: 'pull-source-repositories' builders: - shell: !include-raw: ./scripts/pull-repos.sh - builder: name: 'maven-build-repositories' builders: - shell: !include-raw: ./scripts/maven-build.sh - builder: name: 'maven-clean-repositories' builders: - shell: !include-raw: ./scripts/maven-clean.sh # Builders for packaging artifacts (.war .jar, docker images and source repositories) - builder: name: 'collect-file-artifacts' builders: - shell: !include-raw: ./scripts/collect-artifacts.sh - builder: name: 'package-docker-images' builders: - shell: !include-raw: ./scripts/archive-images.sh - builder: name: 'package-source-repositories' builders: - shell: !include-raw: ./scripts/archive-repos.sh # Builders for promoting/pushing artifacts (.war, .jar, docker images and source repositories) to Artifactory - builder: name: 'promote-file-artifacts-to-artifactory' builders: - shell: !include-raw: ./scripts/push-artifacts.sh - builder: name: 'promote-docker-images-to-artifactory' builders: - shell: !include-raw: ./scripts/push-images.sh - builder: name: 'promote-source-repositories-to-artifactory' builders: - shell: !include-raw: ./scripts/push-repos.sh # Wrapper for Artifactory API Key - wrapper: name: 'artifactory-credentials' wrappers: - credentials-binding: - username-password-separated: credential-id: 'nordix-cicd-arm-credentials' username: NORDIX_ARM_USERNAME password: NORDIX_ARM_TOKEN