Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Jenkins Build for Pantheon → Besu considerations #1

Merged
merged 7 commits into from
Sep 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ build/
out/
site/
/kubernetes/reports/
/kubernetes/pantheon-*.tar.gz
/kubernetes/besu-*.tar.gz
19 changes: 0 additions & 19 deletions CLA.md

This file was deleted.

6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ The process described here has several goals:

Please follow these steps to have your contribution considered by the approvers:

1. Complete the CLA, as described in [CLA.md].
1. Ensure all commits have a Sign-off for DCO, as described in [DCO.md].
2. Follow all instructions in [PULL-REQUEST-TEMPLATE.md](.github/pull_request_template.md).
3. Include appropriate test coverage. Testing is 100% automated. There is no such thing as a manual test.
4. Follow the [Style Guides](#style-guides).
Expand Down Expand Up @@ -242,8 +242,8 @@ These are not strictly enforced during the build, but should be adhered to and c
[private@pegasys.tech]: mailto:private@pegasys.tech
[Rocketchat]: https://chat.hyperledger.org/channel/besu
[Besu documentation]: https://besu.hyperledger.org/
[CLA.md]: /CLA.md
[DCO.md]: ./DCO.md
[Code Reviews]: /docs/community/code-reviews.md
[MkDocs]: https://www.mkdocs.org/
[How to Write a Git Commit Message]: https://chris.beams.io/posts/git-commit/
[Chris Beams]: https://github.com/cbeams
[Chris Beams]: https://github.com/cbeams
9 changes: 9 additions & 0 deletions DCO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
DCO
===

As per section 13.a of the [Hyperledger Charter](https://www.hyperledger.org/about/charter) all code submitted to the Hyperledger Foundation needs to have a [Developer Certificate of Origin](http://developercertificate.org/) (DCO) sign-off.

The sign off needs to be using your legal name, not a pseudonym. Git has a built-in mechanism to allow this with the `-s` or `--signoff` argument to `git commit` command, providing your `user.name` and `user.email` have been setup correctly.

If you have any questions, you can reach us on [Besu chat].
[Besu chat]: https://chat.hyperledger.org/channel/besu
4 changes: 2 additions & 2 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ See [community membership]
Decision making will be handled by the Approvers (see [community membership]). If consensus cannot be reached, the Benevolent Dictator will provide the final word on the decision.


# CLA
# DCO

All contributors must sign the CLA, as described in [CLA.md].
All contributors must send commits with sign-off to comply with [DCO](DCO.md)
## Attribution

This document was influenced by the following:
Expand Down
88 changes: 57 additions & 31 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,33 @@ if (!shouldPublish()) {

try {
timeout(time: 1, unit: 'HOURS') {
parallel UnitTests: {
parallel DCOCheck: {
def stage_name = "DCO tests node: "
node {
checkout scm
docker.image(build_image).inside() {
stage(stage_name + 'Check') {
sh '''#!/bin/bash
status=0
while IFS= read -r -a line; do
my_array+=( "$line" )
done < <( git branch -r | grep -v origin/HEAD )
for branch in "${my_array[@]}"
do
branch=$(echo "$branch" | xargs)
echo "Checking commits in branch $branch for commits missing DCO..."
while read -r results; do
status=1
commit_hash="$(echo "$results" | cut -d' ' -f1)"
>&2 echo "$commit_hash is missing Signed-off-by line."
done < <(git log "$branch" --no-merges --pretty="%H %ae" --grep 'Signed-off-by' --invert-grep -- )
done
exit $status
'''
}
}
}
}, UnitTests: {
def stage_name = "Unit tests node: "
node {
checkout scm
Expand All @@ -73,7 +99,7 @@ try {
archiveArtifacts 'build/reports/**'
archiveArtifacts 'build/distributions/**'

stash allowEmpty: true, includes: 'build/distributions/pantheon-*.tar.gz', name: 'distTarBall'
stash allowEmpty: true, includes: 'build/distributions/besu-*.tar.gz', name: 'distTarBall'

junit '**/build/test-results/**/*.xml'
}
Expand Down Expand Up @@ -224,32 +250,32 @@ try {
}
}
}
// }, BintrayPublish: {
// def stage_name = "Bintray publish node: "
// node {
// if (shouldPublish()) {
// checkout scm
//
// docker.image(docker_image_dind).withRun('--privileged') { d ->
// docker.image(build_image).inside("--link ${d.id}:docker") {
// stage(stage_name + 'Prepare') {
// sh './gradlew --no-daemon --parallel clean assemble'
// }
// stage(stage_name + 'Publish') {
// withCredentials([
// usernamePassword(
// credentialsId: 'pegasys-bintray',
// usernameVariable: 'BINTRAY_USER',
// passwordVariable: 'BINTRAY_KEY'
// )
// ]) {
// sh './gradlew --no-daemon --parallel bintrayUpload'
// }
// }
// }
// }
// }
// }
}, BintrayPublish: {
def stage_name = "Bintray publish node: "
node {
if (shouldPublish()) {
checkout scm

docker.image(docker_image_dind).withRun('--privileged') { d ->
docker.image(build_image).inside("--link ${d.id}:docker") {
stage(stage_name + 'Prepare') {
sh './gradlew --no-daemon --parallel clean assemble'
}
stage(stage_name + 'Publish') {
withCredentials([
usernamePassword(
credentialsId: 'pegasys-bintray',
usernameVariable: 'BINTRAY_USER',
passwordVariable: 'BINTRAY_KEY'
)
]) {
sh './gradlew --no-daemon --parallel bintrayUpload'
}
}
}
}
}
}
}
}
} catch (e) {
Expand All @@ -264,20 +290,20 @@ try {
if (previousResult != null && (previousResult == 'FAILURE' || previousResult == 'UNSTABLE')) {
slackSend(
color: 'good',
message: "Pantheon branch ${env.BRANCH_NAME} build is back to HEALTHY.\nBuild Number: #${env.BUILD_NUMBER}\n${env.BUILD_URL}",
message: "Besu 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: "Pantheon branch ${env.BRANCH_NAME} build is FAILING.\nBuild Number: #${env.BUILD_NUMBER}\n${env.BUILD_URL}",
message: "Besu 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: "Pantheon branch ${env.BRANCH_NAME} build is UNSTABLE.\nBuild Number: #${env.BUILD_NUMBER}\n${env.BUILD_URL}",
message: "Besu branch ${env.BRANCH_NAME} build is UNSTABLE.\nBuild Number: #${env.BUILD_NUMBER}\n${env.BUILD_URL}",
channel: channel
)
}
Expand Down
8 changes: 4 additions & 4 deletions besu/src/test/resources/everything_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# The odds are you are reading this because you added a CLI and didn't add it
# here and a test broke. To fix the test add your CLI to this file.
#
# Please use a plausible value, Pantheon has to at least be able to parse it.
# Please use a plausible value, Besu has to at least be able to parse it.
# If it is a multi-valued CLI make it a TOML array.
# If it is a number or boolean make it a number or boolean
# All other config options are strings, and must be quoted.
# Please provide some sensible grouping.

# Node Information
data-path="~/pantheondata"
data-path="~/besudata"
logging="INFO"
node-private-key-file="./path/to/privateKey"

Expand Down Expand Up @@ -73,7 +73,7 @@ metrics-push-enabled=false
metrics-push-host="5.5.5.1"
metrics-push-port=212
metrics-push-interval=42
metrics-push-prometheus-job="pantheon-everything"
metrics-push-prometheus-job="besu-everything"

# Mining
miner-enabled=false
Expand Down Expand Up @@ -108,4 +108,4 @@ Xincoming-tx-messages-keep-alive-seconds=60
revert-reason-enabled=false

# Storage plugin to use
key-value-storage="rocksdb"
key-value-storage="rocksdb"
8 changes: 4 additions & 4 deletions docker/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pantheon-*.tar.gz
pantheon/*
pantheon-*
reports/*
besu-*.tar.gz
besu/*
besu-*
reports/*