Commit e828ae8a authored by Thibault's avatar Thibault
Browse files

Mise en place du chemin pour une nouvelle image

parent 22c2b8eb
node{
def app
def registryProject='http://registry-nexus:8083/repository/RegistryDocker/'
def image="${registryProject}:version-${env.BUILD_ID}"
stage('Clone') {
checkout scm
}
stage('Scan hadolint'){
sh 'docker run --rm -i hadolint/hadolint < Dockerfile > rapportHadolint || true'
}
stage('Build image') {
app = docker.build ("debian:buster")
}
stage('Test image') {
docker.image('debian:buster').withRun() { c ->
sh 'docker ps'
}
}
stage('Scan Dockle'){
sh 'dockle debian:buster > rapportDockle'
}
stage('Scan Clair'){
sh '''
./clair-scanner --report="rapportClair" --ip=jenkins-blueocean --clair="http://clair-local-scan:6060" debian:buster || exit 0
'''
}
stage('Push on repo nexus'){
docker.withRegistry(registryProject,'Jenkins-credential'){
app.push()
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment