Skip to content

Commit

Permalink
Add COOL as a local lib
Browse files Browse the repository at this point in the history
  • Loading branch information
Thierry Lacour committed Jul 5, 2018
1 parent e372c49 commit c2d89f0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
23 changes: 13 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ lockIf(isIntegration(), 'integration-lock') {
authorName = sh(script: "git log -1 --format='%an' ${inputSHA}", returnStdout: true).trim()
authorEmail = sh(script: "git log -1 --format='%ae' ${inputSHA}", returnStdout: true).trim()

// Somehow these branches don't exist post-clone
sh """\
git fetch origin ${INTEGRATION_BRANCH}:${INTEGRATION_BRANCH}
git fetch origin ${BRANCH_NAME}:${BRANCH_NAME}
""".stripIndent()

// 5 minutes of patience
timeout(5) {
if (!isIntegration()) {
Expand All @@ -38,21 +44,18 @@ lockIf(isIntegration(), 'integration-lock') {
sh """\
git config user.email "${authorEmail}"
git config user.name "${authorName}"
git fetch origin "${INTEGRATION_BRANCH}":"${INTEGRATION_BRANCH}"
git checkout "${INTEGRATION_BRANCH}"
if [ "\$(git branch --contains ${inputSHA} | wc -l)" -gt "0" ]
git checkout "${INTEGRATION_BRANCH}"
if [ "\$(git branch --contains ${inputSHA} | wc -l)" -gt "1" ]
then
echo "MERGE ERROR: ${BRANCH_NAME} already exists in ${INTEGRATION_BRANCH}"
exit 1
fi
COMMITS="\$(git log --oneline ${INTEGRATION_BRANCH}..${inputSHA} | wc -l)"
if [ "\${COMMITS}" -gt "1" ] || ! git merge --ff-only ${inputSHA}
then
git reset --hard origin/${INTEGRATION_BRANCH}
git merge --no-ff --no-commit ${inputSHA}
git commit --author "${authorName} <${authorEmail}>" --message "Merge branch '${BRANCH_NAME}' into '${INTEGRATION_BRANCH}'"
fi""".stripIndent()
git rebase ${INTEGRATION_BRANCH} ${BRANCH_NAME}
git checkout "${INTEGRATION_BRANCH}"
git merge --ff-only ${BRANCH_NAME}
""".stripIndent()
}
}
stash name: 'merge-result', includes: '**', useDefaultExcludes: false
Expand Down
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ apply plugin: 'maven-publish'
repositories {
jcenter()
maven {
url 'http://code.praqma.net/repo/maven/'
url 'https://repo.jenkins-ci.org/public/'
}
}

dependencies {
compile 'net.praqma:cool:0.6.50'
// COOL
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "net.praqma:praqmajutils:1.0.0"

// Other
compile 'org.slf4j:slf4j-api:1.7.25'
compile 'org.codehaus.groovy:groovy-all:2.4.12'
compile 'org.jfrog.artifactory.client:artifactory-java-client-services:1.2.2'
Expand Down
Binary file added libs/cool-0.6.50.jar
Binary file not shown.

0 comments on commit c2d89f0

Please sign in to comment.