Skip to content

Commit

Permalink
Support for adding downstream: releasepy + repo_uploader
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Luis Rivero <[email protected]>
  • Loading branch information
j-rivero committed Sep 7, 2023
1 parent cd95ce3 commit 829dcf6
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 4 deletions.
50 changes: 47 additions & 3 deletions jenkins-scripts/dsl/_configs_/OSRFSourceCreation.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ class OSRFSourceCreation
}
}

static void create(Job job, Map default_params = [:])
static void create(Job job, Map default_params = [:], Map default_hidden_params = [:])
{
OSRFLinuxBuildPkgBase.create(job)
GenericRemoteToken.create(job)
OSRFSourceCreation.addParameters(job, default_params)

def pkg_sources_dir="pkgs"

job.with
{
label Globals.nontest_label("docker")

wrappers {
preBuildCleanup()
}
Expand All @@ -55,6 +55,9 @@ class OSRFSourceCreation
priority 100
}

def canonical_package_name = Globals.get_canonical_package_name(
default_params.find{ it.key == "PACKAGE"}.value)

steps {
systemGroovyCommand("""\
build.setDescription(
Expand Down Expand Up @@ -98,6 +101,47 @@ class OSRFSourceCreation
}
}

// Useful to inject testing jobs
static void call_uploader_and_releasepy(Job job,
String repository_uploader_jobname,
String releasepy_jobname)
{
job.with
{
publishers {
postBuildScripts {
steps {
conditionalSteps {
condition {
not {
expression('none|None|^$','${ENV,var="UPLOAD_TO_REPO"}')
}
}
steps {
// Invoke repository_uploader
downstreamParameterized {
trigger(repository_uploader_jobname) {
parameters {
currentBuild()
predefinedProps([PROJECT_NAME_TO_COPY_ARTIFACTS: '${JOB_NAME}',
S3_UPLOAD_PATH: Globals.s3_upload_tarball_path(package_name)])
propertiesFile(properties_file) // TARBALL_NAME
}
}
}
downstreamParameterized {
trigger(releasepy_jobname) {
parameters {
currentBuild()
predefinedProps([PROJECT_NAME_TO_COPY_ARTIFACTS: "\${JOB_NAME}"])
propertiesFile(properties_file) // TARBALL_NAME
}
}
}
}
}
}
}
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion jenkins-scripts/dsl/test.dsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ OSRFReleasepy.create(releasepy_job, [DRY_RUN: true])
// gz source testing job
def gz_source_job = job("_test_gz_source")
OSRFSourceCreation.create(gz_source_job, [
PACKAGE_NAME: "gz-cmake3",
PACKAGE: "gz-cmake3" ,
SOURCE_REPO_URI: "https://github.com/gazebosim/gz-cmake.git"])
OSRFSourceCreation.call_uploader_and_releasepy(gz_source_job,
'_test_repository_uploader',
'_test_releasepy')

// -------------------------------------------------------------------
def outdated_job_runner = job("_test_outdated_job_runner")
Expand Down

0 comments on commit 829dcf6

Please sign in to comment.