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

[Jenkins] Update the release script and Jenkinsfile #307

Merged
merged 5 commits into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
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
2 changes: 1 addition & 1 deletion dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<configuration>
<excludes>
<exclude>dependency-reduced-pom.xml</exclude>
<exclude>pom.xml.asc</exclude>
<exclude>*pom.xml.asc</exclude>
</excludes>
</configuration>
</plugin>
Expand Down
25 changes: 8 additions & 17 deletions jenkins/Jenkinsfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@
*
*/

def SERVERS_MAP = [
Local: ' ',
Sonatype: 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
]

def SEC_IDS = [
Local: ['local-gpg-passphrase', 'local-gpg-private-key', 'local-username-password'],
Sonatype: ['rapids-gpg-passphrase', 'rapids-gpg-private-key', 'sonatype-username-password']
]

pipeline {
agent { label 'vanilla||docker-deploy||docker-gpu' }

Expand All @@ -41,9 +31,9 @@ pipeline {
}

parameters {
choice(name: 'DEPLOY_TO', choices: ['Sonatype'],
description: 'Where to deploy artifacts to')
string(name: 'REF', defaultValue: 'master', description: 'Commit to build')
string(name: 'DEPLOY_TO', defaultValue: 'https://oss.sonatype.org/service/local/staging/deploy/maven2',
description: 'The repo URL where to deploy the artifacts')
string(name: 'REF', defaultValue: 'main', description: 'Commit to build')
}

environment {
Expand All @@ -66,6 +56,7 @@ pipeline {
$DOCKER_CMD pull $IMAGE_NAME
$DOCKER_CMD logout https://urm.nvidia.com
"""
sh "mkdir -p ${HOME}/.zinc"
docker.image("$IMAGE_NAME").inside("--runtime=nvidia -v ${HOME}/.m2:${HOME}/.m2:rw \
-v ${HOME}/.zinc:${HOME}/.zinc:rw \
-v /etc/passwd:/etc/passwd -v /etc/group:/etc/group") {
Expand All @@ -78,10 +69,10 @@ pipeline {
stage("Deploy") {
environment {
SERVER_ID='ossrh'
SERVER_URL="${SERVERS_MAP["$DEPLOY_TO"]}"
GPG_PASSPHRASE=credentials("${SEC_IDS["$DEPLOY_TO"][0]}")
GPG_FILE=credentials("${SEC_IDS["$DEPLOY_TO"][1]}")
SONATYPE=credentials("${SEC_IDS["$DEPLOY_TO"][2]}")
SERVER_URL="${DEPLOY_TO}"
GPG_PASSPHRASE=credentials('SPARK_RAPIDS_GPG_PASSPHRASE')
GPG_FILE=credentials('SPARK_RAPIDS_GPG_PRIVATE_KEY')
SONATYPE=credentials('SPARK_SONATYPE_USERPASS')
GNUPGHOME="${WORKSPACE}/.gnupg"
}
steps {
Expand Down
12 changes: 12 additions & 0 deletions jenkins/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@
# limitations under the License.
#

# Argument(s):
# SIGN_FILE: true/false, whether to sign the jar/pom file to de deployed
# DATABRICKS: true/fasle, whether deploying for databricks
#
# Used environment(s):
# SQL_PL: The path of module 'sql-plugin', relative to project root path.
# DIST_PL: The path of module 'dist', relative to project root path.
# SERVER_ID: The repository id for this deployment.
# SERVER_URL: The url where to deploy artifacts.
# GPG_PASSPHRASE: The passphrase used to sign files, only required when <SIGN_FILE> is true.
###

set -e
SIGN_FILE=$1
DATABRICKS=$2
Expand Down