Initial commit

This commit is contained in:
jenkins-x-bot 2020-09-11 20:57:41 +08:00
parent 3e41b0ff95
commit a003abfe52
2 changed files with 60 additions and 0 deletions

22
Dockerfile Normal file
View File

@ -0,0 +1,22 @@
# Base on latest (edge) alpine image
FROM harbor.ervine.dev/public/x86_64/alpine:v3.12
LABEL "Maintainer Jonathan Ervine <docker@ervine.org>"
# Install updates
ENV LANG='en_US.UTF-8' \
LANGUAGE='en_US.UTF-8' \
FLASK_APP=/data/app-dev/app.py
RUN apk update && \
apk -U upgrade --ignore alpine-baselayout && \
apk -U add python3 gcc py3-pip python3-dev musl-dev libffi-dev git && \
adduser -D python && \
mkdir /data && cd /data && git clone --single-branch --branch dev https://git.ervine.org/jonny/flask-python-helm /data && \
pip3 install -r /data/requirements.txt && \
rm -rf /tmp/src && rm -rf /var/cache/apk/*
EXPOSE 3000
#USER python
CMD [ "/usr/bin/python3", "/data/main.py" ]

38
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,38 @@
podTemplate(yaml: """
kind: Pod
spec:
containers:
- name: kaniko
image: gcr.io/kaniko-project/executor:debug-539ddefcae3fd6b411a95982a830d987f4214251
imagePullPolicy: Always
command:
- /busybox/cat
tty: true
volumeMounts:
- name: jenkins-docker-cfg
mountPath: /kaniko/.docker
volumes:
- name: jenkins-docker-cfg
projected:
sources:
- secret:
name: regcred
items:
- key: .dockerconfigjson
path: config.json
"""
) {
node(POD_LABEL) {
stage('Build with Kaniko') {
git url: 'ssh://git@git.ervine.org/jonny/x86_64-alpine-helm-python.git', credentialsId: 'jenkins-to-git'
container('kaniko') {
sh '/kaniko/executor -f `pwd`/Dockerfile -c `pwd` --cache=true --destination=harbor.ervine.dev/public/x86_64/alpine/helm:v3.12.0 --destination=harbor.ervine.dev/public/x86_64/alpine/helm:v3.12'
}
}
}
}
stage('Notify gchat') {
hangoutsNotify message: "Helm python flask Application on Alpine Linux 3.12.0 has built",token: "A2ET831pVslqXTqAx6ycu573r",threadByJob: false
}