jobs: added artifact deployment to nexus
Signed-off-by: Marc Mattmüller <marc.mattmueller@netmodule.com>
This commit is contained in:
parent
974b77234d
commit
1aea7bf218
|
|
@ -80,9 +80,9 @@ pipeline {
|
||||||
script {
|
script {
|
||||||
dir("${env.YOCTO_REPO_DIR}") {
|
dir("${env.YOCTO_REPO_DIR}") {
|
||||||
common.buildTheYoctoPackage()
|
common.buildTheYoctoPackage()
|
||||||
def artifactName = "NWL-${machine}.zip"
|
env.ARTIFACT_NAME = "NWL-${machine}.zip"
|
||||||
common.collectingPackageArtifacts("${env.MACHINE}")
|
common.collectingPackageArtifacts("${env.MACHINE}")
|
||||||
common.packAndArchiveArtifacts("${env.MACHINE}", artifactName)
|
common.packAndArchiveArtifacts("${env.MACHINE}", "${env.ARTIFACT_NAME}")
|
||||||
}
|
}
|
||||||
println "TODO: sync sstate-cache to the server"
|
println "TODO: sync sstate-cache to the server"
|
||||||
}
|
}
|
||||||
|
|
@ -93,7 +93,7 @@ pipeline {
|
||||||
when { expression { return common.isCurrentJobSuccess() } }
|
when { expression { return common.isCurrentJobSuccess() } }
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
println "TODO: Deploy artifacts"
|
deployToArtifactory(common)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -162,3 +162,15 @@ def setupEnvironment(commonHelpers) {
|
||||||
commonHelpers.setupBuildEnvironment(machine, nwlBranch, nwlRepoDir, params.DEBUGGING)
|
commonHelpers.setupBuildEnvironment(machine, nwlBranch, nwlRepoDir, params.DEBUGGING)
|
||||||
commonHelpers.printEnvironmentParameters()
|
commonHelpers.printEnvironmentParameters()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
def deployToArtifactory(commonHelpers) {
|
||||||
|
def artifactFilepath = "${env.DEPLOY_CONTENT_DIR}/${env.ARTIFACT_NAME}"
|
||||||
|
def nexusGroupId = "nwl.${env.CI_IMAGE}"
|
||||||
|
def nexusArtifactId = "${env.MACHINE}"
|
||||||
|
def nexusVersion = "latest"
|
||||||
|
|
||||||
|
println "deploying ${artifactFilepath} as ${nexusGroupId}.${nexusArtifactId} to Nexus..."
|
||||||
|
commonHelpers.deployArtifactToNexusArtifactory(artifactFilepath, "zip", nexusGroupId, nexusArtifactId, nexusVersion)
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,15 @@ env.YOCTO_RELEASE = 'kirkstone'
|
||||||
env.CI_IMAGE = "nwl-image-testable"
|
env.CI_IMAGE = "nwl-image-testable"
|
||||||
|
|
||||||
|
|
||||||
|
// Artifactory
|
||||||
|
//----------------------------
|
||||||
|
env.NEXUS_URL = "artifactory.gad.local:443"
|
||||||
|
env.NEXUS_VERSION = "nexus3"
|
||||||
|
env.NEXUS_PROTOCOL = "https"
|
||||||
|
env.NEXUS_REPOSITORY = "maven-releases"
|
||||||
|
env.NEXUS_ARTIFACT_COPIER_URL = "${env.NEXUS_PROTOCOL}://${env.NEXUS_URL}/repository/${env.NEXUS_REPOSITORY}"
|
||||||
|
|
||||||
|
|
||||||
// Methods declared in external code are accessible
|
// Methods declared in external code are accessible
|
||||||
// directly from other code in the external file
|
// directly from other code in the external file
|
||||||
// indirectly via the object created by the load operation
|
// indirectly via the object created by the load operation
|
||||||
|
|
@ -320,6 +329,27 @@ def packAndArchiveArtifacts(machine, pkgArchiveName) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// deploy an artifact to the Nexus Artifactory
|
||||||
|
def deployArtifactToNexusArtifactory(artifactPathname, artifactType, groupId, artifactId, version) {
|
||||||
|
nexusArtifactUploader(
|
||||||
|
nexusVersion: "${env.NEXUS_VERSION}",
|
||||||
|
protocol: "${env.NEXUS_PROTOCOL}",
|
||||||
|
nexusUrl: "${env.NEXUS_URL}",
|
||||||
|
groupId: "${groupId}",
|
||||||
|
version: "${version}",
|
||||||
|
repository: "${env.NEXUS_REPOSITORY}",
|
||||||
|
credentialsId: "nexus_uploader_credentials",
|
||||||
|
artifacts: [
|
||||||
|
[artifactId: "${artifactId}",
|
||||||
|
classifier: "",
|
||||||
|
file: "${artifactPathname}",
|
||||||
|
type: "${artifactType}"]
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// !!Important Boilerplate!!
|
// !!Important Boilerplate!!
|
||||||
// The external code must return it's contents as an object
|
// The external code must return it's contents as an object
|
||||||
return this;
|
return this;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue