Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
uphrh-smf-devops
Commits
8858ccf0
Commit
8858ccf0
authored
3 years ago
by
root
Browse files
Options
Download
Patches
Plain Diff
added Jenkinsfile
parent
f186708b
master
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pipelines/Dockerfile
+6
-0
pipelines/Dockerfile
pipelines/Jenkinsfile
+44
-0
pipelines/Jenkinsfile
with
50 additions
and
0 deletions
+50
-0
pipelines/Dockerfile
0 → 100644
+
6
−
0
View file @
8858ccf0
FROM
nginx:1.13.8-alpine
RUN
rm
-rf
/etc/nginx/conf.d
RUN
rm
-rf
/usr/share/nginx/html
This diff is collapsed.
Click to expand it.
pipelines/Jenkinsfile
0 → 100644
+
44
−
0
View file @
8858ccf0
node
()
{
try
{
String
ANSI_GREEN
=
"\u001B[32m"
String
ANSI_NORMAL
=
"\u001B[0m"
String
ANSI_BOLD
=
"\u001B[1m"
String
ANSI_RED
=
"\u001B[31m"
String
ANSI_YELLOW
=
"\u001B[33m"
ansiColor
(
'xterm'
)
{
stage
(
'Checkout'
)
{
cleanWs
()
checkout
scm
commit_hash
=
sh
(
script:
'git rev-parse --short HEAD'
,
returnStdout:
true
).
trim
()
env
.
commit_id
=
sh
(
script:
"echo "
+
"form"
+
"_"
+
commit_hash
+
"_"
+
env
.
BUILD_NUMBER
,
returnStdout:
true
).
trim
()
echo
"${env.commit_id}"
}
}
stage
(
'docker-build'
)
{
sh
'''
docker build --no-cache -f pipelines/Dockerfile -t $docker_server/$docker_repo:$commit_id .
'''
}
stage
(
'docker-push'
)
{
sh
'''
docker push $docker_server/$docker_repo:$commit_id
docker rmi -f $docker_server/$docker_repo:$commit_id
'''
}
stage
(
'ArchiveArtifacts'
)
{
sh
(
"echo ${commit_id} > commit_id.txt"
)
archiveArtifacts
"commit_id.txt"
currentBuild
.
description
=
"${commit_id}"
}
}
catch
(
err
)
{
currentBuild
.
result
=
"FAILURE"
throw
err
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets