Skip to content

Commit

Permalink
push artifacts to repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhavanaashok33 committed Jul 31, 2024
1 parent ad084f8 commit 310117d
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion pipeline-rpm-script
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ pipeline {
BRANCH = 'master'
RPM_DIR = "$WORKSPACE/docker/rpms"
SIGNED_RPMS = "$WORKSPACE/rpmbuild/RPMS/noarch"
ARTIFACTORY_USER = 'noiro.gen'
ARTIFACTORY_URL = 'https://engci-maven.cisco.com/artifactory'
ARTIFACT_URL = 'https://engci-maven.cisco.com/artifactory/noiro-snapshot/opflex/master/rhel8/agent/$BUILD_NUMBER'
}
stages {
stage('Build Opflex RPMS') {
Expand Down Expand Up @@ -49,6 +52,23 @@ pipeline {
}
}
}
stage('Push artifacts') {
steps {
script {
withCredentials([
conjurSecretCredential(credentialsId: 'noiro-conjur-artifactory-token', variable: 'ARTIFACT_TOKEN')
]) {
script {
sh """
for rpm in ${SIGNED_RPMS}/opflexrpms-${BUILD_NUMBER}/*.rpm
do curl -v -u ${ARTIFACTORY_USER}:\${ARTIFACT_TOKEN} -X PUT "${ARTIFACT_URL}/\$(basename \$rpm)" -T "\$rpm"
done
"""
}
}
}
}
}
stage('Re-Tar Signed RPMs') {
steps {
script {
Expand All @@ -61,4 +81,4 @@ pipeline {
}
}
}
}
}

0 comments on commit 310117d

Please sign in to comment.