Abandon travis-ci for jenkins
All checks were successful
moparisthebest/aptIn16/pipeline/head This commit looks good

This commit is contained in:
Travis Burtrum 2020-11-17 21:54:04 -05:00
parent 78b4a488fc
commit 174eda3bde
5 changed files with 73 additions and 30 deletions

42
.ci/Jenkinsfile vendored Normal file
View File

@ -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: 'admin.jenkins@moparisthebest.com', sendToIndividuals: true])
}
deleteDir()
}
}

29
.ci/build.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
set -euxo pipefail
[ $JAVA_VERSION -lt 6 -o $JAVA_VERSION -gt 8 ] && echo "build does not support JAVA_VERSION: $JAVA_VERSION" && exit 0
echo "starting build for JAVA_VERSION: $JAVA_VERSION"
# grab all deps with java 8
run-java 8 mvn dependency:go-offline
# install deps
mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
# clean and test
mvn clean test -B
# publish only from java 6 and master branch
if [ "$BRANCH_NAME" == "master" -a $JAVA_VERSION -eq 6 ]
then
echo 'deploying to maven'
# java 6 cannot do modern SSL, use java 8 to deploy
run-java 8 mvn deploy -Dmaven.test.skip=true -B
mkdir -p release
find -type f -name '*.jar' -print0 | xargs -0n1 -I {} mv '{}' 'release/'
fi
echo 'build success!'
exit 0

View File

@ -1,9 +0,0 @@
<settings>
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
</servers>
</settings>

View File

@ -1,21 +0,0 @@
language: java
sudo: false
dist: trusty
addons:
apt:
packages:
- ca-certificates-java
- openjdk-7-jre-headless
jdk:
- openjdk7
after_success:
- if [[ "${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" == 'master' ]]; then
mvn deploy --settings .travis-settings.xml -DskipTests=true -B || travis_terminate 1;
fi
cache:
directories:
- $HOME/.m2

View File

@ -1,5 +1,7 @@
# aptIn16
[![Build Status](https://ci.moparisthe.best/job/moparisthebest/job/aptIn16/job/master/badge/icon%3Fstyle=plastic)](https://ci.moparisthe.best/job/moparisthebest/job/aptIn16/job/master/)
aptIn16 is an implementation of the [Annotation Processing Tool (apt)][6] [com.sun.mirror.*][1] classes allowing classes implementing them to run as [Java 1.6 annotation processors][2] inside of javac ([JSR 269][3]). This is orders of magnitude faster than [apt][6]. It can be used by anyone who currently relies on apt but would like to switch to the newer/faster javac.
In short, it implements [com.sun.mirror][1] using [javax.annotation.processing][4] and [javax.lang.model][5] in the background.