Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
docker-secu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RISCH Rayan
docker-secu
Commits
e22322aa
Commit
e22322aa
authored
4 years ago
by
Thibault
Browse files
Options
Downloads
Patches
Plain Diff
ajout de commentaire
parent
e828ae8a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
JenkinsImageExistante/Jenkinsfile
+12
-1
12 additions, 1 deletion
JenkinsImageExistante/Jenkinsfile
JenkinsNouvelleImage/Jenkinsfile
+9
-0
9 additions, 0 deletions
JenkinsNouvelleImage/Jenkinsfile
with
21 additions
and
1 deletion
JenkinsImageExistante/Jenkinsfile
+
12
−
1
View file @
e22322aa
...
...
@@ -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
'''
}
}
}
This diff is collapsed.
Click to expand it.
JenkinsNouvelleImage/Jenkinsfile
+
9
−
0
View file @
e22322aa
...
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment