Skip to content

Commit

Permalink
Jenkinsfile: use versionary to implement version scheme
Browse files Browse the repository at this point in the history
This uses the new `versionary.py` script which implements the new
versioning scheme:

coreos/fedora-coreos-releng-automation#50
  • Loading branch information
jlebon committed Dec 11, 2019
1 parent 826e00d commit 98d78d3
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ properties([
choices: (streams.development + streams.production + streams.mechanical),
description: 'Fedora CoreOS stream to build',
required: true),
// XXX: Temporary parameter for first few FCOS preview releases. We
// eventually want some way to drive this automatically as per the
// versioning scheme.
// https://github.com/coreos/fedora-coreos-tracker/issues/212
string(name: 'VERSION',
description: 'Override default versioning mechanism',
defaultValue: '',
Expand Down Expand Up @@ -134,6 +130,13 @@ echo "Final podspec: ${pod}"
podTemplate(cloud: 'openshift', label: 'coreos-assembler', yaml: pod, defaultContainer: 'jnlp') {
node('coreos-assembler') { container('coreos-assembler') {

// Clone the automation repo, which contains helper scripts. In the
// future, we'll probably want this either part of the cosa image, or
// in a derivative of cosa for pipeline needs.
utils.shwrap("""
git clone https://github.com/coreos/fedora-coreos-releng-automation /var/tmp/fcos-releng
""")

// this is defined IFF we *should* and we *can* upload to S3
def s3_stream_dir

Expand Down Expand Up @@ -222,7 +225,13 @@ podTemplate(cloud: 'openshift', label: 'coreos-assembler', yaml: pod, defaultCon
}

def force = params.FORCE ? "--force" : ""
def version = params.VERSION ? "--version ${params.VERSION}" : ""
def version
if (params.VERSION) {
version = "--version ${params.VERSION}"
} else if (official) {
def new_version = utils.shwrap_capture("/var/tmp/fcos-releng/scripts/versionary.py")
version = "--version ${new_version}"
}
utils.shwrap("""
coreos-assembler build ostree --skip-prune ${force} ${version} ${parent_arg}
""")
Expand Down Expand Up @@ -367,7 +376,6 @@ podTemplate(cloud: 'openshift', label: 'coreos-assembler', yaml: pod, defaultCon
// Run the coreos-meta-translator against the most recent build,
// which will generate a release.json from the meta.json files
utils.shwrap("""
git clone https://github.com/coreos/fedora-coreos-releng-automation /var/tmp/fcos-releng
/var/tmp/fcos-releng/coreos-meta-translator/trans.py --workdir .
""")

Expand Down

0 comments on commit 98d78d3

Please sign in to comment.