-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a922e4a
commit 9ca4366
Showing
5 changed files
with
70 additions
and
37 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,42 @@ | ||
properties( | ||
[ | ||
disableConcurrentBuilds() | ||
] | ||
) | ||
|
||
node('linux && docker') { | ||
try { | ||
stage('Checkout') { | ||
//branch name from Jenkins environment variables | ||
echo "My branch is: ${env.BRANCH_NAME}" | ||
|
||
// this doesn't grab tags pointing to this branch | ||
//checkout scm | ||
// this hack does... https://issues.jenkins.io/browse/JENKINS-45164 | ||
checkout([ | ||
$class: 'GitSCM', | ||
branches: [[name: 'refs/heads/'+env.BRANCH_NAME]], | ||
extensions: [[$class: 'CloneOption', noTags: false, shallow: false, depth: 0, reference: '']], | ||
userRemoteConfigs: scm.userRemoteConfigs, | ||
]) | ||
sh ''' | ||
set -euxo pipefail | ||
git checkout "$BRANCH_NAME" -- | ||
git reset --hard "origin/$BRANCH_NAME" | ||
''' | ||
} | ||
|
||
stage('Build + Deploy') { | ||
sh 'curl --compressed -sL https://code.moparisthebest.com/moparisthebest/self-ci/raw/branch/master/build-ci.sh | bash' | ||
} | ||
|
||
currentBuild.result = 'SUCCESS' | ||
} catch (Exception err) { | ||
currentBuild.result = 'FAILURE' | ||
} finally { | ||
stage('Email') { | ||
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: '[email protected]', sendToIndividuals: true]) | ||
} | ||
deleteDir() | ||
} | ||
} |
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,25 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
[ $JAVA_VERSION -lt 8 ] && echo "build does not support JAVA_VERSION: $JAVA_VERSION" && exit 0 | ||
|
||
echo "starting build for JAVA_VERSION: $JAVA_VERSION" | ||
|
||
# install deps | ||
mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V | ||
|
||
# clean and test | ||
mvn clean test -B | ||
|
||
# publish only from java 8 and master branch | ||
if [ "$BRANCH_NAME" == "master" -a $JAVA_VERSION -eq 8 ] | ||
then | ||
echo 'deploying to maven' | ||
mvn deploy -Dmaven.test.skip=true -B | ||
|
||
mkdir -p release | ||
mv './jDnsProxy-all/target/jDnsProxy-all.jar' 'release/jDnsProxy.jar' | ||
fi | ||
|
||
echo 'build success!' | ||
exit 0 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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