Skip to content
This repository has been archived by the owner on Jun 12, 2020. It is now read-only.

Commit

Permalink
Merge pull request #9 from cdit-ma/v1.3.1-release
Browse files Browse the repository at this point in the history
logan v1.3.1 release
  • Loading branch information
danielrfraser authored Oct 18, 2017
2 parents d3a979c + 75dd66e commit 9e3d779
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 8 deletions.
2 changes: 1 addition & 1 deletion client/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
std::condition_variable lock_condition_;
std::mutex mutex_;
std::string VERSION_NAME = "LOGAN_CLIENT";
std::string VERSION_NUMBER = "1.3";
std::string VERSION_NUMBER = "1.3.1";

void signal_handler (int signal_value){
//Gain the lock so we can notify to terminate
Expand Down
51 changes: 46 additions & 5 deletions jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
// This method collects a list of Node names from the current Jenkins instance
/* This Jenkinsfile:
1. Pulls the latest logan source from a specified git repo (defaults to github.com)
2. Stashes+pops this repo to all nodes with the "logan" tag
3. Builds logan for production use on these nodes
*/

//Collect a list of Node names from the current Jenkins instance
@NonCPS
def nodeNames() {
return jenkins.model.Jenkins.instance.nodes.collect { node -> node.name }
}

//Get labels attached to node name
def getLabels(String name){
def computer = Jenkins.getInstance().getComputer(name)
def node = computer.getNode()
Expand All @@ -13,8 +20,26 @@ def getLabels(String name){
return ""
}

//Check that the correct params are specified in the jenkins configuration
def git_url = ""
git_url = env.GIT_URL
if(git_url == null){
print("ERROR: \"GIT_URL\" string parameter missing in build configuration")
currentBuild.result = 'FAILURE'
return
}

def git_credential_id = ""
git_credential_id = env.GIT_CREDENTIAL_ID
if(git_credential_id == null){
print("ERROR: \"GIT_CREDENTIAL_ID\" credential parameter missing in build configuration")
currentBuild.result = 'FAILURE'
return
}

def names = nodeNames()
//filter nodes

//Filter out non logan nodes
def filtered_names = []
for(n in names){
if(getLabels(n).contains("logan")){
Expand All @@ -23,9 +48,24 @@ for(n in names){
}
}

//If param is empty, use default
def default_git_url = "https://github.com/cdit-ma/logan.git"
if(!git_url){
git_url = default_git_url
}

def git_user = input(id: 'git_user', message: 'Select GitHub Credentials', parameters: [[$class: 'CredentialsParameterDefinition', defaultValue: '', description: 'Git User', name: 'git_user']])
//Checkout logan on master node and stash
stage('Checkout'){
node("master"){
dir("logan"){
deleteDir()
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'SubmoduleOption', disableSubmodules: false, parentCredentials: true, recursiveSubmodules: false, reference: '', trackingSubmodules: false]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: git_credential_id, url: git_url]]])
stash includes: "**", name: "logan_source"
}
}
}

//Unstash on all logan nodes
stage('Checkout'){
def builders = [:]
for(n in filtered_names){
Expand All @@ -34,14 +74,15 @@ stage('Checkout'){
node(node_name){
def loganPath = "${LOGAN_PATH}"
dir(loganPath){
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'SubmoduleOption', disableSubmodules: false, parentCredentials: true, recursiveSubmodules: false, reference: '', trackingSubmodules: false]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: git_user, url: 'https://github.com/cdit-ma/logan.git']]])
unstash "logan_source"
}
}
}
}
parallel builders
}

//Build on all logan nodes
stage('Build'){
def builders = [:]
for(n in filtered_names){
Expand All @@ -57,6 +98,6 @@ stage('Build'){
}
}
}
parallel builders
}
parallel builders
}
2 changes: 1 addition & 1 deletion re_common
2 changes: 1 addition & 1 deletion server/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ std::mutex mutex_;
std::condition_variable lock_condition_;

std::string VERSION_NAME = "LOGAN_SERVER";
std::string VERSION_NUMBER = "1.3";
std::string VERSION_NUMBER = "1.3.1";
std::string DEFAULT_FILE = "out.sql";

void signal_handler(int sig)
Expand Down

0 comments on commit 9e3d779

Please sign in to comment.