Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
Initial project setup
Browse files Browse the repository at this point in the history
  • Loading branch information
rain-on committed Mar 1, 2019
1 parent 82f05eb commit a2254cb
Show file tree
Hide file tree
Showing 17 changed files with 1,556 additions and 22 deletions.
48 changes: 26 additions & 22 deletions .gitignore
@@ -1,23 +1,27 @@
# Compiled class file
*.class

# Log file
*.bak
*.swp
*.tmp
*~.nib
*.iml
*.launch
*.swp
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
.classpath
.DS_Store
.externalToolBuilders/
.gradle/
.idea/
.loadpath
.metadata
.prefs
.project
.recommenders/
.settings
.springBeans
.vertx
bin/
local.properties
target/
tmp/
build/
out/
70 changes: 70 additions & 0 deletions Jenkinsfile
@@ -0,0 +1,70 @@
#!/usr/bin/env groovy

if (env.BRANCH_NAME == "master") {
properties([
buildDiscarder(
logRotator(
daysToKeepStr: '90'
)
)
])
} else {
properties([
buildDiscarder(
logRotator(
numToKeepStr: '10'
)
)
])
}

try {
node {
checkout scm
docker.image('openjdk:11-jdk-stretch').inside {
try {
stage('Build') {
sh './gradlew --no-daemon --parallel build'
}
stage('Test') {
sh './gradlew --no-daemon --parallel test'
}
} finally {
archiveArtifacts '**/build/reports/**'
archiveArtifacts '**/build/test-results/**'

junit allowEmptyResults: true, testResults: '**/build/test-results/**/*.xml'
}
}
}
} catch (e) {
currentBuild.result = 'FAILURE'
} finally {
// If we're on master and it failed, notify slack
if (env.BRANCH_NAME == "master") {
def currentResult = currentBuild.result ?: 'SUCCESS'
def channel = '#team-dropbear-priv'
if (currentResult == 'SUCCESS') {
def previousResult = currentBuild.previousBuild?.result
if (previousResult != null && (previousResult == 'FAILURE' || previousResult == 'UNSTABLE')) {
slackSend(
color: 'good',
message: "EthFirewall branch ${env.BRANCH_NAME} build is back to HEALTHY.\nBuild Number: #${env.BUILD_NUMBER}\n${env.BUILD_URL}",
channel: channel
)
}
} else if (currentBuild.result == 'FAILURE') {
slackSend(
color: 'danger',
message: "EthFirewall branch ${env.BRANCH_NAME} build is FAILING.\nBuild Number: #${env.BUILD_NUMBER}\n${env.BUILD_URL}",
channel: channel
)
} else if (currentBuild.result == 'UNSTABLE') {
slackSend(
color: 'warning',
message: "EthFirewall branch ${env.BRANCH_NAME} build is UNSTABLE.\nBuild Number: #${env.BUILD_NUMBER}\n${env.BUILD_URL}",
channel: channel
)
}
}
}

0 comments on commit a2254cb

Please sign in to comment.