Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
synergy
o3skim
Commits
6d89ee56
Commit
6d89ee56
authored
Aug 18, 2020
by
BorjaEst
Browse files
Merge branch 'dev'
parents
09447918
a13e80bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
6d89ee56
...
...
@@ -22,9 +22,12 @@ LABEL maintainer='Borja Esteban'
ARG
branch=master
# Which user and group to use
ARG
user=
worker
ARG
user=
application
ARG
group=standard
# Set environments
ENV
LANG C.UTF-8
# Install system updates and tools
ENV
DEBIAN_FRONTEND=noninteractive
RUN
apt-get update
&&
apt-get
install
-y
--no-install-recommends
\
...
...
@@ -44,16 +47,14 @@ RUN git clone --depth 1 -b ${branch} https://github.com/BorjaEst/cicd.git app &&
rm -rf /tmp/*
WORKDIR
/app
# Set environments
ENV
LANG C.UTF-8
# Ports to expose
EXPOSE
8443
EXPOSE
8080
# Change user context and drop root privileges
RUN
groupadd
-r
${
group
}
&&
\
useradd
--no-log-init
-r
-g
${
group
}
${
user
}
useradd
--no-log-init
-r
-d
/app
-g
${
group
}
${
user
}
&&
\
chown
-R
${
user
}
.
USER
${user}
# Start default script
...
...
Jenkinsfile
View file @
6d89ee56
pipeline
{
agent
{
dockerfile
true
}
environment
{
registry
=
"boressan/cicd"
registryCredential
=
'dockerhub_id'
}
agent
any
stages
{
stage
(
'Image build'
)
{
steps
{
echo
'====================building image===================================='
script
{
customImage
=
docker
.
build
(
registry
)
}
}
}
stage
(
'Unit testing'
)
{
steps
{
echo
'====================executing unittest================================'
echo
'Edit Jenkinsfile - Install test dependencies'
echo
'Edit Jenkinsfile - Trigger unittesting'
script
{
customImage
.
inside
(
"--entrypoint=''"
)
{}
}
}
}
stage
(
'Docker-hub upload'
)
{
steps
{
echo
'====================uploading docker-hub=============================='
script
{
docker
.
withRegistry
(
''
,
registryCredential
)
{
customImage
.
push
(
'master'
)
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment