Commit 6d89ee56 authored by BorjaEst's avatar BorjaEst
Browse files

Merge branch 'dev'

parents 09447918 a13e80bf
......@@ -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
......
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') } }
}
}
}
......
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