-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from msknext/release-1.14
Release 1.14
- Loading branch information
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
node('build-slave') { | ||
try { | ||
String ANSI_GREEN = "\u001B[32m" | ||
String ANSI_NORMAL = "\u001B[0m" | ||
String ANSI_BOLD = "\u001B[1m" | ||
String ANSI_RED = "\u001B[31m" | ||
String ANSI_YELLOW = "\u001B[33m" | ||
|
||
ansiColor('xterm') { | ||
stage('Checkout') { | ||
cleanWs() | ||
def scmVars = checkout scm | ||
if (params.github_release_tag == "") { | ||
checkout scm | ||
commit_hash = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim() | ||
branch_name = sh(script: 'git name-rev --name-only HEAD | rev | cut -d "/" -f1| rev', returnStdout: true).trim() | ||
artifact_version = branch_name + "_" + commit_hash | ||
println(ANSI_BOLD + ANSI_YELLOW + "github_release_tag not specified, using the latest commit hash: " + commit_hash + ANSI_NORMAL) | ||
} | ||
else { | ||
checkout scm: [$class: 'GitSCM', branches: [[name: "refs/tags/${params.github_release_tag}"]], userRemoteConfigs: [[url: scmVars.GIT_URL]]] | ||
artifact_version = params.github_release_tag | ||
println(ANSI_BOLD + ANSI_YELLOW + "github_release_tag specified, building from: " + params.github_release_tag + ANSI_NORMAL) | ||
} | ||
echo "artifact_version: "+ artifact_version | ||
} | ||
|
||
|
||
stage('Build') { | ||
sh """ | ||
mkdir sunbird_auth_1.0v | ||
wget https://downloads.jboss.org/keycloak/3.2.0.Final/keycloak-3.2.0.Final.tar.gz | ||
tar -xvf keycloak-3.2.0.Final.tar.gz --strip 1 -C sunbird_auth_1.0v | ||
mkdir -p sunbird_auth_1.0v/providers | ||
mkdir -p sunbird_auth_1.0v/modules/system/layers/keycloak/org/postgresql/main | ||
mkdir -p sunbird_auth_1.0v/themes/sunbird/login | ||
wget https://jdbc.postgresql.org/download/postgresql-9.4.1212.jar | ||
mv postgresql-9.4.1212.jar sunbird_auth_1.0v/modules/system/layers/keycloak/org/postgresql/main | ||
cd keycloak/sms-provider | ||
mvn package | ||
cp target/keycloak-email-phone-autthenticator-1.0-SNAPSHOT.jar $WORKSPACE/sunbird_auth_1.0v/providers | ||
cp -r templates/* $WORKSPACE/sunbird_auth_1.0v/themes/sunbird/login | ||
""" | ||
} | ||
|
||
stage('ArchiveArtifacts') { | ||
sh """ | ||
mkdir keycloak_artifacts | ||
zip -r keycloak_artifacts.zip:${artifact_version} sunbird_auth_1.0v | ||
""" | ||
archiveArtifacts artifacts: "keycloak_artifacts.zip:${artifact_version}", fingerprint: true, onlyIfSuccessful: true | ||
sh """echo {\\"artifact_name\\" : \\"keycloak_artifacts.zip\\", \\"artifact_version\\" : \\"${artifact_version}\\", \\"node_name\\" : \\"${env.NODE_NAME}\\"} > metadata.json""" | ||
archiveArtifacts "metadata.json" | ||
currentBuild.description = "${artifact_version}" | ||
} | ||
} | ||
|
||
} | ||
catch (err) { | ||
currentBuild.result = "FAILURE" | ||
throw err | ||
} | ||
|
||
} |