Skip to content

Commit

Permalink
Update indexfiles at stage level
Browse files Browse the repository at this point in the history
Signed-off-by: Divya Madala <[email protected]>
  • Loading branch information
Divyaasm committed Dec 13, 2023
1 parent 6444bd9 commit 64015bb
Show file tree
Hide file tree
Showing 2 changed files with 143 additions and 46 deletions.
95 changes: 72 additions & 23 deletions jenkins/opensearch-dashboards/distribution-build.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ pipeline {
String buildManifestUrlOpenSearch = [buildManifestObj.getArtifactRootUrl(JOB_NAME_OPENSEARCH, "latest"), "builds", "opensearch", "manifest.yml"].join("/")
String artifactUrl = buildManifestObj.getArtifactUrl(JOB_NAME, BUILD_NUMBER)
env.ARTIFACT_URL_LINUX_X64_TAR = artifactUrl
env.INDEX_FILE_PATH = buildManifestObj.getIndexFileRoot("${JOB_NAME}")
env.INDEX_FILE_PATH_X64_TAR = buildManifestObj.getIndexFileRoot("${JOB_NAME}")

echo "buildManifestUrl (linux, x64, tar): ${buildManifestUrl}"
echo "artifactUrl (linux, x64, tar): ${artifactUrl}"
Expand Down Expand Up @@ -224,6 +224,15 @@ pipeline {
}
}
post {
success {
script {
if (params.UPDATE_LATEST_URL) {
uploadIndexFile(
indexFilePath: env.INDEX_FILE_PATH_X64_TAR
)
}
}
}
always {
script {
lib.jenkins.Messages.new(this).add(
Expand Down Expand Up @@ -301,6 +310,7 @@ pipeline {
String buildManifestUrl = buildManifestObj.getUrl(JOB_NAME, BUILD_NUMBER)
String artifactUrl = buildManifestObj.getArtifactUrl(JOB_NAME, BUILD_NUMBER)
env.ARTIFACT_URL_LINUX_X64_RPM = artifactUrl
env.INDEX_FILE_PATH_X64_RPM = buildManifestObj.getIndexFileRoot("${JOB_NAME}")

echo "buildManifestUrl (linux, x64, rpm): ${buildManifestUrl}"
echo "artifactUrl (linux, x64, rpm): ${artifactUrl}"
Expand All @@ -319,6 +329,15 @@ pipeline {
}
}
post {
success {
script {
if (params.UPDATE_LATEST_URL) {
uploadIndexFile(
indexFilePath: env.INDEX_FILE_PATH_X64_RPM
)
}
}
}
always {
script {
lib.jenkins.Messages.new(this).add(
Expand Down Expand Up @@ -398,6 +417,7 @@ pipeline {
String buildManifestUrl = buildManifestObj.getUrl(JOB_NAME, BUILD_NUMBER)
String artifactUrl = buildManifestObj.getArtifactUrl(JOB_NAME, BUILD_NUMBER)
env.ARTIFACT_URL_LINUX_X64_DEB = artifactUrl
env.INDEX_FILE_PATH_X64_DEB = buildManifestObj.getIndexFileRoot("${JOB_NAME}")

echo "buildManifestUrl (linux, x64, deb): ${buildManifestUrl}"
echo "artifactUrl (linux, x64, deb): ${artifactUrl}"
Expand All @@ -407,6 +427,15 @@ pipeline {
}
}
post {
success {
script {
if (params.UPDATE_LATEST_URL) {
uploadIndexFile(
indexFilePath: env.INDEX_FILE_PATH_X64_DEB
)
}
}
}
always {
script {
lib.jenkins.Messages.new(this).add(
Expand Down Expand Up @@ -496,6 +525,8 @@ pipeline {
String buildManifestUrlOpenSearch = [buildManifestObj.getArtifactRootUrl(JOB_NAME_OPENSEARCH, "latest"), "builds", "opensearch", "manifest.yml"].join("/")
String artifactUrl = buildManifestObj.getArtifactUrl(JOB_NAME, BUILD_NUMBER)
env.ARTIFACT_URL_LINUX_ARM64_TAR = artifactUrl
env.INDEX_FILE_PATH_ARM64_TAR = buildManifestObj.getIndexFileRoot("${JOB_NAME}")

echo "buildManifestUrl (linux, arm64, tar): ${buildManifestUrl}"
echo "artifactUrl (linux, arm64, tar): ${artifactUrl}"

Expand Down Expand Up @@ -534,6 +565,15 @@ pipeline {
}
}
post {
success {
script {
if (params.UPDATE_LATEST_URL) {
uploadIndexFile(
indexFilePath: env.INDEX_FILE_PATH_ARM64_TAR
)
}
}
}
always {
script {
lib.jenkins.Messages.new(this).add(
Expand Down Expand Up @@ -619,6 +659,8 @@ pipeline {
String buildManifestUrl = buildManifestObj.getUrl(JOB_NAME, BUILD_NUMBER)
String artifactUrl = buildManifestObj.getArtifactUrl(JOB_NAME, BUILD_NUMBER)
env.ARTIFACT_URL_LINUX_ARM64_RPM = artifactUrl
env.INDEX_FILE_PATH_ARM64_RPM = buildManifestObj.getIndexFileRoot("${JOB_NAME}")

echo "buildManifestUrl (linux, arm64, rpm): ${buildManifestUrl}"
echo "artifactUrl (linux, arm64, rpm): ${artifactUrl}"

Expand All @@ -636,6 +678,15 @@ pipeline {
}
}
post {
success {
script {
if (params.UPDATE_LATEST_URL) {
uploadIndexFile(
indexFilePath: env.INDEX_FILE_PATH_ARM64_RPM
)
}
}
}
always {
script {
lib.jenkins.Messages.new(this).add(
Expand Down Expand Up @@ -715,6 +766,7 @@ pipeline {
String buildManifestUrl = buildManifestObj.getUrl(JOB_NAME, BUILD_NUMBER)
String artifactUrl = buildManifestObj.getArtifactUrl(JOB_NAME, BUILD_NUMBER)
env.ARTIFACT_URL_LINUX_ARM64_DEB = artifactUrl
env.INDEX_FILE_PATH_ARM64_DEB = buildManifestObj.getIndexFileRoot("${JOB_NAME}")

echo "buildManifestUrl (linux, arm64, deb): ${buildManifestUrl}"
echo "artifactUrl (linux, arm64, deb): ${artifactUrl}"
Expand All @@ -724,6 +776,15 @@ pipeline {
}
}
post {
success {
script {
if (params.UPDATE_LATEST_URL) {
uploadIndexFile(
indexFilePath: env.INDEX_FILE_PATH_ARM64_DEB
)
}
}
}
always {
script {
lib.jenkins.Messages.new(this).add(
Expand Down Expand Up @@ -771,14 +832,23 @@ pipeline {
String buildManifestUrl = buildManifestObj.getUrl(JOB_NAME, BUILD_NUMBER)
String artifactUrl = buildManifestObj.getArtifactUrl(JOB_NAME, BUILD_NUMBER)
env.ARTIFACT_URL_LINUX_WINDOWS_X64_ZIP = artifactUrl
env.INDEX_FILE_PATH = buildManifestObj.getIndexFileRoot("${JOB_NAME}")
env.INDEX_FILE_PATH_X64_ZIP = buildManifestObj.getIndexFileRoot("${JOB_NAME}")

echo "buildManifestUrl (windows, x64, zip): ${buildManifestUrl}"
echo "artifactUrl (windows, x64, zip): ${artifactUrl}"

}
}
post {
success {
script {
if (params.UPDATE_LATEST_URL) {
uploadIndexFile(
indexFilePath: env.INDEX_FILE_PATH_X64_ZIP
)
}
}
}
always {
script {
lib.jenkins.Messages.new(this).add(
Expand All @@ -792,26 +862,6 @@ pipeline {
}
}
}
stage('update index file') {
agent {
docker {
label AGENT_LINUX_X64
image dockerAgent.image
args dockerAgent.args
registryUrl 'https://public.ecr.aws/'
alwaysPull true
}
}
steps {
script {
if (params.UPDATE_LATEST_URL) {
uploadIndexFile(
indexFilePath: env.INDEX_FILE_PATH
)
}
}
}
}
stage('docker build') {
when {
beforeAgent true
Expand Down Expand Up @@ -934,4 +984,3 @@ pipeline {
}
}
}

Loading

0 comments on commit 64015bb

Please sign in to comment.