Skip to content

Commit

Permalink
[Jenkins] Update the release script and Jenkinsfile (NVIDIA#307)
Browse files Browse the repository at this point in the history
* Update the credential IDs for public release

* Exclude all the '.asc' files for rat check

* Restore the second paramter for deploy script

* Make the directory '.zinc' before starting docker

To avoid being created by docker as root user.

* Remove the first label for release

Co-authored-by: Liangcai Li <liangcail@nvidia.com>
  • Loading branch information
firestarman and firestarman authored Jul 1, 2020
1 parent da560d3 commit 69fd06c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
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
27 changes: 9 additions & 18 deletions jenkins/Jenkinsfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,8 @@
*
*/

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' }
agent { label 'docker-deploy||docker-gpu' }

options {
ansiColor('xterm')
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

0 comments on commit 69fd06c

Please sign in to comment.