lib = library(identifier: 'jenkins@1.5.4', retriever: modernSCM([ $class: 'GitSCMSource', remote: 'https://github.com/opensearch-project/opensearch-build-libraries.git', ])) pipeline { options { timeout(time: 2, unit: 'HOURS') } agent none environment { AGENT_X64 = 'Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host' } triggers { parameterizedCron ''' H 1 * * * %INPUT_MANIFEST=1.3.12/opensearch-1.3.12.yml ''' } parameters { string( name: 'COMPONENT_NAME', description: 'If this field contains one or more component names (e.g. OpenSearch common-utils ...), will build with "--component ...", else build everything in the INPUT_MANIFEST.', trim: true ) string( name: 'INPUT_MANIFEST', description: 'Input manifest under the manifests folder, e.g. 2.0.0/opensearch-2.0.0.yml.', trim: true ) } stages { stage('dockerAgent-setup') { agent { docker { label AGENT_X64 image 'docker/library/alpine:3' registryUrl 'https://public.ecr.aws/' alwaysPull true } } steps { script { echo("Detect Docker Images and Related Parameters") dockerAgent = detectDockerAgent() currentBuild.description = INPUT_MANIFEST } } } stage('publish-maven-snaphots') { environment { SNAPSHOT_REPO_URL = "https://aws.oss.sonatype.org/content/repositories/snapshots/" } agent { docker { label AGENT_X64 image dockerAgent.image args dockerAgent.args alwaysPull true } } steps { script { buildManifest( componentName: "${COMPONENT_NAME}", inputManifest: "manifests/${INPUT_MANIFEST}", platform: 'linux', architecture: 'x64', distribution: 'tar', snapshot: true ) String mavenPath = "$WORKSPACE/tar/builds/opensearch/maven" if (fileExists(mavenPath)) { withCredentials([ string(credentialsId: 'maven-snapshots-username', variable: 'SONATYPE_USERNAME'), string(credentialsId: 'maven-snapshots-password', variable: 'SONATYPE_PASSWORD') ]) { sh("$WORKSPACE/publish/publish-snapshot.sh ${mavenPath}") } } else { echo "Skipping publishing snapshots, ${mavenPath} does not exist." } } } post { always { postCleanup() } } } } }