From 99ab89db67ad96de9af4e199ff8ccd8a49de553b Mon Sep 17 00:00:00 2001 From: Jonathan Ervine Date: Wed, 1 Apr 2020 14:40:09 +0800 Subject: [PATCH] new file: Dockerfile new file: Jenkinsfile Initial commit --- Dockerfile | 14 ++++++++++++++ Jenkinsfile | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 Dockerfile create mode 100644 Jenkinsfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cf4241c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +# Base on latest (edge) alpine image +FROM harbor.ervine.dev/library/x86_64/alpine/alpine-3.10 + +MAINTAINER “Jonathan Ervine” + +# Install updates +ENV LANG='en_US.UTF-8' \ + LANGUAGE='en_US.UTF-8' + +RUN apk update && apk -U upgrade && apk add python3 git + +VOLUME /data + +CMD [ "/bin/sh" ] diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..d26438f --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,18 @@ +node("docker-node") { + docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') { + + git branch: "3.10.3", url: "ssh://git@git.ervine.org:2222/jonny/alpine-kubespray-installer", credentialsId: 'jenkins-to-git' + + sh "git rev-parse HEAD > .git/commit-id" + def commit_id = readFile('.git/commit-id').trim() + println commit_id + + stage "build" + def app = docker.build "library/x86_64/alpine/kubespray" + + stage "publish" + app.push("${env.BUILD_NUMBER}") + app.push("latest") + app.push("3.10") + } +}