Skip to content

Commit

Permalink
Using credentials for release tool job (#139)
Browse files Browse the repository at this point in the history
* Bump actions/checkout from 4.0.0 to 4.1.0 (#138)

Bumps [actions/checkout](https://github.com/actions/checkout) from 4.0.0
to 4.1.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@3df4ab1...8ade135)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Test

Signed-off-by: Sophia Guo <sophia.gwf@gmail.com>

* Test 3

Signed-off-by: Sophia Guo <sophia.gwf@gmail.com>

* Credential token

Signed-off-by: Sophia Guo <sophia.gwf@gmail.com>

* Using single quote for security

Signed-off-by: Sophia Guo <sophia.gwf@gmail.com>

* Minor update

Signed-off-by: Sophia Guo <sophia.gwf@gmail.com>

* Update to java 17

Signed-off-by: Sophia Guo <sophia.gwf@gmail.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Sophia Guo <sophia.gwf@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
sophia-guo and dependabot[bot] committed Oct 11, 2023
1 parent 779bbb8 commit 7f0d1ae
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ pipeline {
copyArtifactPermission('*');
}
parameters {
password(name: 'GITHUB_TOKEN', defaultValue: 'SECRET', description: 'Leave this')
string(name: 'TAG', defaultValue: '', description: 'The GitHub tag of the release, e.g. jdk-12+33')
choice(name: 'VERSION', choices: ['jdk21', 'jdk20', 'jdk19', 'jdk17', 'jdk11', 'jdk8'], description: 'Which JDK Version?')
string(name: 'UPSTREAM_JOB_NAME', defaultValue: '', description: 'The full path to the pipeline / job, e.g. build-scripts/openjdk12-pipeline')
Expand All @@ -19,7 +18,7 @@ Or **/*x64_linux*.tar.gz,**/*x64_linux*.sha256.txt,**/*x64_linux*.json,**/*x64_l
string(name: 'ARTIFACTS_TO_SKIP', defaultValue: '', description: 'For example in most release builds we skip the testimage: *testimage*.')
string(name: 'TIMESTAMP', defaultValue: '', description: 'Optional timestamp to add for nightly builds.')
booleanParam(name: 'DRY_RUN', defaultValue: false, description: 'Tick this box will not release the binary to GitHub')
booleanParam(name: 'UPLOAD_TESTRESULTS_ONLY', defaultValue: false, description: 'Tick this box to actually release the binary to GitHub')
booleanParam(name: 'UPLOAD_TESTRESULTS_ONLY', defaultValue: false, description: 'Tick this box to release test tap results to GitHub')
}
stages {
stage('Upload Releases') {
Expand Down Expand Up @@ -58,10 +57,15 @@ Or **/*x64_linux*.tar.gz,**/*x64_linux*.sha256.txt,**/*x64_linux*.json,**/*x64_l
excludes: "${params.ARTIFACTS_TO_SKIP}",
projectName: "${upstreamJobName}",
selector: [$class: 'SpecificBuildSelector', buildNumber: "${upstreamJobNumber}"]])
sh '''
export VERSION=`echo $VERSION | awk '{print toupper($0)}'`
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 ./sbin/Release.sh
'''

withCredentials([string(credentialsId: "${params.GITHUB_CREDENTIAL}", variable: 'secretToken')]) {
withEnv(['GITHUB_TOKEN=' + secretToken]) {
sh '''
export VERSION=`echo $VERSION | awk '{print toupper($0)}'`
JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 ./sbin/Release.sh
'''
}
}
} catch (Exception err) {
echo err.getMessage()
currentBuild.result = 'FAILURE'
Expand Down

0 comments on commit 7f0d1ae

Please sign in to comment.