new file: Dockerfile

new file:   Jenkinsfile
Initial commit
This commit is contained in:
Jonathan Ervine 2020-04-22 11:33:21 +08:00
parent a689867f35
commit 5f8e4ae7fa
2 changed files with 52 additions and 0 deletions

29
Dockerfile Normal file
View File

@ -0,0 +1,29 @@
# Base on latest (edge) alpine image
FROM opensuse/leap:15.1
MAINTAINER “Jonathan Ervine” <docker@ervine.org>
# Install updates
ENV LANG='en_US.UTF-8' \
LANGUAGE='en_US.UTF-8' \
TERM='xterm' \
STEP_USER='step' \
STEP_GROUP='step' \
STEP_UID='1001' \
STEP_GID='1001' \
STEP_VERSION='0.14.2'
RUN zypper -n in tar wget gzip
RUN groupadd -g $STEP_GID $STEP_GROUP
RUN useradd -u $STEP_UID -g $STEP_GROUP -M $STEP_USER
RUN wget https://github.com/smallstep/cli/releases/download/v$STEP_VERSION/step_linux_$STEP_VERSION_amd64.tar.gz \
mkdir -p /step/bin \
tar -xxvf step_linux_$STEP_VERSION_amd64.tar.gz -C /step/bin/ \
rm step_linux_$STEP_VERSION_amd64.tar.gz
EXPOSE 9000/tcp
USER $STEP_USER
CMD [ "/bin/sh" ]

23
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,23 @@
node("docker-node") {
docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') {
git branch: "master", url: "ssh://git@git.ervine.org:2222/jonny/x86_64-suse-stepCA", credentialsId: 'jenkins-to-git'
sh "git rev-parse HEAD > .git/commit-id"
def commit_id = readFile('.git/commit-id').trim()
println commit_id
try {
stage "build"
def app = docker.build "library/x86_64/suse/stepCA"
stage "publish"
app.push("${env.BUILD_NUMBER}")
app.push("latest")
app.push("0.14.2")
}
catch (err) {
currentBuild.result = 'FAILURE'
}
}
}