Skip to content

Commit

Permalink
Remove old code
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 Nov 22, 2024
1 parent eac4d49 commit 979c26d
Showing 1 changed file with 0 additions and 60 deletions.
60 changes: 0 additions & 60 deletions jenkins-scripts/dsl/test.dsl
Original file line number Diff line number Diff line change
Expand Up @@ -191,63 +191,3 @@ OSRFCredentials.allowOsrfbuildToRunTheBuild(test_dummy_job)
test_dummy_job.with {
label Globals.nontest_label("docker")
}

// --------------------------------------------------------------------
def test_credentials_token_job = job("_test_job_osrfbuild-credentials-token_from_dsl")
OSRFBase.create(test_credentials_token_job)
GitHubCredentials.createOsrfbuildToken(test_credentials_token_job)
test_credentials_token_job.with
{
label "docker"

steps {
shell("""\
#!/bin/bash -xe

echo "Testing the login into the Jenkins server:"
curl --silent --fail --write '\\nReturn code: %{http_code}\\n' --user "\${OSRFBUILD_USER}:\${OSRFBUILD_TOKEN}" \${JENKINS_URL} --output /dev/null
""".stripIndent())

shell("""\
#!/bin/bash -xe

# Check push+commit permissions for osrfbuild by uploading/deleting a
# branch. Note that call to the API for permissions require of admin
# perms that osrfbuild user does not have. Personal tokens don't
# support ssh but https only.

rm -fr homebrew-simulation
git clone https://github.com/\${OSRFBUILD_USER}/homebrew-simulation.git
cd homebrew-simulation
git config user.name \${OSRFBUILD_USER} --replace-all
git config user.email "\${OSRFBUILD_USER}@openrobotics.org" --replace-all
git config url."https://\${OSRFBUILD_USER}:\${OSRFBUILD_TOKEN}@github.com/\${OSRFBUILD_USER}/homebrew-simulation.git".InsteadOf https://github.com/\${OSRFBUILD_USER}/homebrew-simulation.git
git checkout -b _test_job_osrfbuild_
git commit --allow-empty -m "testing commit"
# protect token from errors
git push -u origin _test_job_osrfbuild_ > push_log
git push origin --delete _test_job_osrfbuild_ >> push_log
""".stripIndent())
}

publishers
{
postBuildScripts {
steps {
shell("""\
#!/bin/bash -xe

# remove token after the build ends unconditionally
rm -fr \${WORKSPACE}/homebrew-simulation/.git/config
""".stripIndent())
}

onlyIfBuildSucceeds(false)
onlyIfBuildFails(false)
}
}

wrappers {
preBuildCleanup()
}
}

0 comments on commit 979c26d

Please sign in to comment.