Skip to content
Snippets Groups Projects
Commit e22322aa authored by Thibault's avatar Thibault
Browse files

ajout de commentaire

parent e828ae8a
No related branches found
No related tags found
No related merge requests found
......@@ -3,14 +3,21 @@ node{
def registryProject='http://registry-nexus:8083/repository/RegistryDocker/'
def image="${registryProject}:version-${env.BUILD_ID}"
/*
Pull image depuis une registry nexus
*/
//Clonage du projet gitlab gitlab
stage('Clone') {
checkout scm
}
//Build image docker
stage('Build image') {
app = docker.build ("debian:buster")
}
//Test de l'image pour voir si elle est correctement créée
stage('Test image') {
docker.image('debian:buster').withRun() { c ->
......@@ -18,13 +25,17 @@ node{
}
}
//Scan dockle (audit des bonnes pratiques du conteneur docker)
stage('Scan Dockle'){
sh 'dockle debian:buster > rapportDockleEx'
}
//Scan clair (permet de détecter les cve)
stage('Scan Clair'){
sh '''
./clair-scanner --report="rapportClairEx" --ip=jenkins-blueocean --clair="http://clair-local-scan:6060" debian:buster || exit 0
'''
}
}
}
......@@ -3,33 +3,42 @@ node{
def registryProject='http://registry-nexus:8083/repository/RegistryDocker/'
def image="${registryProject}:version-${env.BUILD_ID}"
//Clonage du projet gitlab gitlab
stage('Clone') {
checkout scm
}
//Scan hadolint pour detecter la mise en place des bonnes pratique
stage('Scan hadolint'){
sh 'docker run --rm -i hadolint/hadolint < Dockerfile > rapportHadolint || true'
}
//Build image docker
stage('Build image') {
app = docker.build ("debian:buster")
}
//Test de l'image pour voir si elle est correctement créée
stage('Test image') {
docker.image('debian:buster').withRun() { c ->
sh 'docker ps'
}
}
//Scan dockle (audit des bonnes pratiques du conteneur docker)
stage('Scan Dockle'){
sh 'dockle debian:buster > rapportDockle'
}
//Scan clair (permet de détecter les cve)
stage('Scan Clair'){
sh '''
./clair-scanner --report="rapportClair" --ip=jenkins-blueocean --clair="http://clair-local-scan:6060" debian:buster || exit 0
'''
}
//Push de l'image dans un registry nexus
stage('Push on repo nexus'){
docker.withRegistry(registryProject,'Jenkins-credential'){
app.push()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment