jenkins: remove Jenkinsfile.gerrit (#2953)
This commit is contained in:
parent
587be8f206
commit
28353823e8
@ -1,113 +0,0 @@
|
||||
pipeline {
|
||||
agent {
|
||||
dockerfile {
|
||||
filename 'Dockerfile.jenkins'
|
||||
args '-u root:root --cap-add SYS_PTRACE -v "/tmp/gomod":/go/pkg/mod'
|
||||
label 'gerrit'
|
||||
}
|
||||
}
|
||||
options {
|
||||
timeout(time: 14, unit: 'MINUTES')
|
||||
}
|
||||
stages {
|
||||
stage('Start') {
|
||||
steps {
|
||||
gerritReview message: 'Building'
|
||||
sh 'python ./scripts/gerrit-cla.py'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
steps {
|
||||
checkout scm
|
||||
|
||||
sh 'mkdir -p .build'
|
||||
|
||||
// make a backup of the mod file in case, for later linting
|
||||
sh 'cp go.mod .build/go.mod.orig'
|
||||
// download dependencies
|
||||
sh 'go mod download'
|
||||
|
||||
sh 'go install -v -race ./...'
|
||||
sh 'make install-sim'
|
||||
|
||||
sh 'service postgresql start'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Verification') {
|
||||
parallel {
|
||||
stage('Lint') {
|
||||
steps {
|
||||
sh 'go run ./scripts/check-copyright.go'
|
||||
sh 'go run ./scripts/check-large-files.go'
|
||||
sh 'go run ./scripts/check-imports.go -race ./...'
|
||||
sh 'go run ./scripts/check-peer-constraints.go -race -fail=false'
|
||||
sh 'go run ./scripts/protobuf.go --protoc=$HOME/protoc/bin/protoc lint'
|
||||
sh 'go run ./scripts/protobuf.go --protoc=$HOME/protoc/bin/protoc check-lock'
|
||||
sh 'go run ./scripts/atomicalign.go ./...'
|
||||
sh 'go run ./scripts/check-errs.go ./...'
|
||||
sh 'bash ./scripts/check-dbx-version.sh'
|
||||
sh 'golangci-lint -j=2 run'
|
||||
sh 'go run scripts/check-mod-tidy.go -mod .build/go.mod.orig'
|
||||
sh 'make check-satellite-config-lock'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Tests') {
|
||||
environment {
|
||||
STORJ_POSTGRES_TEST = 'postgres://postgres@localhost/teststorj?sslmode=disable'
|
||||
COVERFLAGS = "${ env.BRANCH_NAME != 'master' ? '' : '-coverprofile=.build/coverprofile -coverpkg=-coverpkg=storj.io/storj/bootstrap/...,storj.io/storj/internal/...,storj.io/storj/lib/...,storj.io/storj/pkg/...,storj.io/storj/satellite/...,storj.io/storj/storage/...,storj.io/storj/storagenode/...,storj.io/storj/uplink/...,storj.io/storj/versioncontrol/...'}"
|
||||
}
|
||||
steps {
|
||||
sh 'psql -U postgres -c \'create database teststorj;\''
|
||||
sh 'go run scripts/use-ports.go -from 1024 -to 10000 &'
|
||||
sh 'go test -vet=off $COVERFLAGS -timeout 12m -json -race ./... 2>&1 | tee .build/tests.json | go run ./scripts/xunit.go -out .build/tests.xml'
|
||||
sh 'go run scripts/check-clean-directory.go'
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
sh script: 'cat .build/tests.json | tparse -all -top -slow 100', returnStatus: true
|
||||
archiveArtifacts artifacts: '.build/tests.json'
|
||||
junit '.build/tests.xml'
|
||||
|
||||
script {
|
||||
if(fileExists(".build/coverprofile")){
|
||||
sh script: 'go run ./scripts/cover-remove-generated.go < .build/coverprofile > .build/clean.coverprofile', returnStatus: true
|
||||
sh script: 'gocov convert .build/clean.coverprofile > .build/cover.json', returnStatus: true
|
||||
sh script: 'gocov-xml < .build/cover.json > .build/cobertura.xml', returnStatus: true
|
||||
cobertura coberturaReportFile: '.build/cobertura.xml'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Integration') {
|
||||
environment {
|
||||
// use different hostname to avoid port conflicts
|
||||
STORJ_NETWORK_HOST4 = '127.0.0.2'
|
||||
STORJ_NETWORK_HOST6 = '127.0.0.2'
|
||||
|
||||
STORJ_SIM_POSTGRES = 'postgres://postgres@localhost/teststorj2?sslmode=disable'
|
||||
}
|
||||
|
||||
steps {
|
||||
sh 'psql -U postgres -c \'create database teststorj2;\''
|
||||
sh 'make test-sim'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
success { gerritReview labels: [Verified: 1], message: 'Success' }
|
||||
failure { gerritReview labels: [Verified: -1], message: 'Failure' }
|
||||
always {
|
||||
sh "chmod -R 777 ." // ensure Jenkins agent can delete the working directory
|
||||
deleteDir()
|
||||
}
|
||||
}
|
||||
}
|
4
Makefile
4
Makefile
@ -74,9 +74,9 @@ proto: ## Rebuild protobuf files
|
||||
.PHONY: build-packages
|
||||
build-packages: build-packages-race build-packages-normal build-npm ## Test docker images locally
|
||||
build-packages-race:
|
||||
go install -v ./...
|
||||
go build -v ./...
|
||||
build-packages-normal:
|
||||
go install -v -race ./...
|
||||
go build -v -race ./...
|
||||
build-npm:
|
||||
cd web/satellite && npm ci
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user