trying to find the bug
This commit is contained in:
parent
6ddc8a3f44
commit
195f553942
@ -101,84 +101,6 @@ sonar.go.coverage.reportPaths=cover.out
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ('Run Tests') {
|
||||
steps {
|
||||
container ('golang') {
|
||||
script {
|
||||
writeFile(file: workspace + "/test-chamber-13.lan.root.crt", text: functions.getCurrentRootCA())
|
||||
sh """
|
||||
if [ ! "/usr/bin/curl" ] || [ ! -x "/usr/bin/curl" ]; then
|
||||
apk add --no-cache curl
|
||||
fi
|
||||
if [ ! "/usr/bin/git" ] || [ ! -x "/usr/bin/git" ]; then
|
||||
apk add --no-cache git
|
||||
git config --global --add safe.directory '${workspace}'
|
||||
fi
|
||||
apk add --no-cache gcc musl-dev
|
||||
curl \
|
||||
--silent \
|
||||
--location \
|
||||
--cacert <( printf '%s\\n' "\$(cat "${workspace}/test-chamber-13.lan.root.crt")" "\$(cat "${workspace}/test-chamber-13.lan.ret.root.crt")" ) \
|
||||
https://nexus.c.test-chamber-13.lan/repository/github-releases/jstemmer/go-junit-report/releases/download/v1.0.0/go-junit-report-v1.0.0-linux-amd64.tar.gz \
|
||||
| tar -z -x -f - -C /usr/local/bin
|
||||
ln -s "${workspace}" "/go/src/${env.JOB_BASE_NAME}"
|
||||
cd "/go/src/${env.JOB_BASE_NAME}"
|
||||
go test -short -coverprofile=cover.out \$(go list ./... | grep -v vendor/)
|
||||
go test -v ./... 2>&1 | go-junit-report > report.xml
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ('SonarQube Analysis') {
|
||||
steps {
|
||||
container ('sonar') {
|
||||
script {
|
||||
try {
|
||||
withSonarQubeEnv('SonarQube') {
|
||||
sh "sonar-scanner --define sonar.host.url=https://sonar.c.test-chamber-13.lan"
|
||||
}
|
||||
} catch(ex) {
|
||||
unstable('Unable to communicate with Sonarqube or Sonarqube sumission failed.')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ('Build & Push') {
|
||||
steps {
|
||||
container ('kaniko') {
|
||||
script {
|
||||
declarativeFunctions.buildContainerMultipleDestinations(
|
||||
dockerFile: dockerFile,
|
||||
repositoryAccess: [
|
||||
[
|
||||
repository: "registry.hub.docker.com",
|
||||
credentials: "dockerhub-repository-creds"
|
||||
],
|
||||
],
|
||||
destination: [
|
||||
"registry.hub.docker.com/thespider/istheinternetonfire:latest",
|
||||
]
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Submit Testing Report to Jenkins') {
|
||||
steps {
|
||||
script {
|
||||
catchError{
|
||||
junit 'report.xml'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user