Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use credential bindings for osrfbuild github token #353

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions jenkins-scripts/dsl/brew_release.dsl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ release_job.with
'Version of the package just released')
stringParam('SOURCE_TARBALL_SHA','',
'SHA Hash of the tarball file')
credentialsBinding {
// credential name needs to be in sync with provision code at infra/osrf-chef repo
string('GITHUB_TOKEN', 'osrfbuild-token')
}
}

steps
Expand Down Expand Up @@ -254,9 +258,13 @@ bottle_job_hash_updater.with

parameters
{
// reuse the pull request created by homebrew_pull_request_updater in step 1
stringParam("PULL_REQUEST_URL", '',
'Pull request URL (osrf/homebrew-simulation) pointing to a pull request.')
// reuse the pull request created by homebrew_pull_request_updater in step 1
stringParam("PULL_REQUEST_URL", '',
'Pull request URL (osrf/homebrew-simulation) pointing to a pull request.')
credentialsBinding {
// credential name needs to be in sync with provision code at infra/osrf-chef repo
string('GITHUB_TOKEN', 'osrfbuild-token')
}
}

steps
Expand Down
12 changes: 0 additions & 12 deletions jenkins-scripts/lib/_homebrew_github_setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@ if [[ -z $(ssh -T git@github.com 2>&1 | grep successfully) ]]; then
exit 1
fi

GITHUB_TOKEN_FILE="/var/lib/jenkins/.github_token"
if [[ ! -f ${GITHUB_TOKEN_FILE} ]]; then
echo "The hub cli tool needs a valid token at file ${GITHUB_TOKEN_FILE}"
echo "The file was not found"
exit 1
fi

set +x # keep password secret
export GITHUB_TOKEN=`cat $GITHUB_TOKEN_FILE`
set -x # back to debug
echo '# END SECTION'

echo '# BEGIN SECTION: download linuxbrew'
/bin/bash -c "$(curl -fsSL https://github.com/raw/Homebrew/install/master/install.sh)"
echo '# END SECTION'
Expand Down