Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
jenkinsfile: move openwrt build from release pipeline to main pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
robaerd committed Sep 11, 2021
1 parent bb8ac52 commit 9f96c22
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 29 deletions.
27 changes: 27 additions & 0 deletions scripts/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,13 @@ def dockerInit() {
"./scripts/docker/fedora/34/release.Dockerfile",
false
)

/* Image to build openwrt package */
DOCKER_IMAGES.openwrt_sdk = dockerUtils.createDockerImageDesc(
'openwrt-sdk', dockerUtils.&idTesting,
'./scripts/docker/openwrt/sdk',
'./scripts/docker/openwrt/sdk/Dockerfile'
)
}
}

Expand Down Expand Up @@ -1100,6 +1107,8 @@ def generateArtifactStages() {
true
)

tasks << buildOpenwrtPackage(DOCKER_IMAGES.openwrt_sdk)

tasks << buildWebsite()
// tasks << buildWebUI()

Expand Down Expand Up @@ -1221,6 +1230,24 @@ def updateDebianChangelog() {
).trim()
}

/**
* Build OpenWrt packages with the current current git master state.
*
* @param image which docker image should be used
*/
def buildOpenwrtPackage(image) {
def stageName = 'build-openwrt-package'
return [(stageName): {
maybeStage(stageName, isMaster()) {
withDockerEnv(image, [DockerOpts.MOUNT_MIRROR]) {
checkout scm
sh "./scripts/release/prepare-openwrt-makefile.sh /home/build/openwrt/package/feeds/packages/elektra/Makefile"
sh "cd /home/build/openwrt && make package/feeds/packages/elektra/compile || make -j1 package/feeds/packages/elektra/compile V=sc"
deleteDir()
}
}
}]
}

def deployDockerContainer(name, imageDesc, hostName) {
node("frontend") {
Expand Down
29 changes: 0 additions & 29 deletions scripts/jenkins/Jenkinsfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,6 @@ def dockerInit() {
"./scripts/docker/website/Dockerfile",
false
)

/* Image to build openwrt package */
DOCKER_IMAGES.openwrt_sdk = dockerUtils.createDockerImageDesc(
'openwrt-sdk', dockerUtils.&idTesting,
'./scripts/docker/openwrt/sdk',
'./scripts/docker/openwrt/sdk/Dockerfile'
)
}
}

Expand Down Expand Up @@ -369,8 +362,6 @@ def generateReleaseStages() {
true // use placeholder dirs
)

tasks << buildOpenwrtPackage(DOCKER_IMAGES.openwrt_sdk)

return tasks
}

Expand Down Expand Up @@ -686,26 +677,6 @@ def buildRelease(stageName, image, packageRevision='1',
}]
}


/**
* Build OpenWrt packages with the current current git master state.
*
* @param image which docker image should be used
*/
def buildOpenwrtPackage(image) {
def stageName = 'build-openwrt-package'
return [(stageName): {
stage(stageName) {
withDockerEnv(image, [DockerOpts.MOUNT_MIRROR]) {
checkout scm
sh "./scripts/release/prepare-openwrt-makefile.sh /home/build/openwrt/package/feeds/packages/elektra/Makefile"
sh "cd /home/build/openwrt && make package/feeds/packages/elektra/compile || make -j1 package/feeds/packages/elektra/compile V=sc"
deleteDir()
}
}
}]
}

/**
* Tests installed packages in docker container and archives results
*
Expand Down

0 comments on commit 9f96c22

Please sign in to comment.