Skip to content

Commit

Permalink
main and tags are always stable
Browse files Browse the repository at this point in the history
  • Loading branch information
rustydb committed Jul 26, 2021
1 parent 8879fc8 commit 1258843
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 8 additions & 9 deletions Jenkinsfile.github
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@Library('csm-shared-library') _

def isStable = env.TAG_NAME != null || env.BRANCH_NAME == 'main' ? true : false
pipeline {
agent {
label "metal-gcp-builder"
Expand All @@ -11,13 +12,11 @@ pipeline {
}

environment {
NAME = sh(returnStdout: true, script: "basename -s .git ${GIT_URL}").trim()
GIT_REPO_NAME = sh(returnStdout: true, script: "basename -s .git ${GIT_URL}").trim()
DESCRIPTION = "Datasource for cloud-init metadata"
IS_STABLE = getBuildIsStable()
VERSION = getDockerBuildVersion(isStable: env.IS_STABLE)
DOCKER_ARGS = getDockerBuildArgs(name: env.NAME, description: env.DESCRIPTION)
BUILD_METADATA = getRpmRevision(isStable: env.IS_STABLE)
VERSION = getDockerBuildVersion(isStable: isStable)
BUILD_METADATA = getRpmRevision(isStable: isStable)
GIT_REPO_NAME = getRepoName()
DOCKER_ARGS = getDockerBuildArgs(name: getRepoName(), description: env.DESCRIPTION)
}

stages {
Expand All @@ -37,7 +36,7 @@ pipeline {
stage('Publish: Image') {
steps {
script {
publishCsmDockerImage(image: env.NAME, tag: env.VERSION, isStable: env.IS_STABLE)
publishCsmDockerImage(image: env.GIT_REPO_NAME, tag: env.VERSION, isStable: isStable)
}
}
}
Expand All @@ -60,8 +59,8 @@ pipeline {
stage('Publish: RPM') {
steps {
script {
publishCsmRpms(component: env.GIT_REPO_NAME, pattern: "dist/rpmbuild/RPMS/x86_64/*.rpm", arch: "x86_64", isStable: env.IS_STABLE)
publishCsmRpms(component: env.GIT_REPO_NAME, pattern: "dist/rpmbuild/SRPMS/*.rpm", arch: "src", isStable: env.IS_STABLE)
publishCsmRpms(component: env.GIT_REPO_NAME, pattern: "dist/rpmbuild/RPMS/x86_64/*.rpm", arch: "x86_64", isStable: isStable)
publishCsmRpms(component: env.GIT_REPO_NAME, pattern: "dist/rpmbuild/SRPMS/*.rpm", arch: "src", isStable: isStable)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ rpm_build:
BUILD_METADATA=$(BUILD_METADATA) rpmbuild --nodeps -ba $(SPEC_FILE) --define "_topdir $(BUILD_DIR)"

image:
docker build --pull ${DOCKER_ARGS} --tag '${NAME}:${VERSION}' .
docker build --pull ${DOCKER_ARGS} --tag '${GIT_REPO_NAME}:${VERSION}' .

0 comments on commit 1258843

Please sign in to comment.