new file: Dockerfile
new file: Jenkinsfile new file: requirements.txt
This commit is contained in:
parent
48c6f40b01
commit
40387b221b
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# Base on latest (edge) alpine image
|
||||||
|
FROM harbor.ervine.dev/library/x86_64/alpine/alpine-3.11
|
||||||
|
|
||||||
|
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 && \
|
||||||
|
apk -U add python3 gcc py3-pip python3-dev musl-dev libffi-dev git && \
|
||||||
|
adduser -D python
|
||||||
|
|
||||||
|
RUN mkdir /data && cd /data && git clone --single-branch --branch dev https://git.ervine.org/jonny/gcp-hockey-results /data
|
||||||
|
|
||||||
|
RUN pip3 install -r /data/requirements.txt
|
||||||
|
|
||||||
|
RUN rm -rf /tmp/src && rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
|
||||||
|
#USER python
|
||||||
|
|
||||||
|
CMD [ "/usr/bin/python3", "/data/main.py" ]
|
||||||
26
Jenkinsfile
vendored
Normal file
26
Jenkinsfile
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
node("docker-node") {
|
||||||
|
docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') {
|
||||||
|
|
||||||
|
git branch: "3.11.6", url: "ssh://git@git.ervine.org/jonny/x86_64-alpine-hockey", 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/alpine/hockey"
|
||||||
|
|
||||||
|
stage "publish"
|
||||||
|
app.push("${env.BUILD_NUMBER}")
|
||||||
|
app.push("latest")
|
||||||
|
|
||||||
|
stage('Deploy on K8s'){
|
||||||
|
sh "/usr/local/bin/kubectl -n dev delete po --all"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
currentBuild.result = 'FAILURE'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
26
requirements.txt
Normal file
26
requirements.txt
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
attrs==17.4.0
|
||||||
|
bcrypt==3.1.4
|
||||||
|
cffi==1.11.4
|
||||||
|
click==6.7
|
||||||
|
Flask==0.12.2
|
||||||
|
Flask-BasicAuth
|
||||||
|
Flask-Bootstrap
|
||||||
|
Flask-Bcrypt==0.7.1
|
||||||
|
Flask-Login==0.4.1
|
||||||
|
Flask-SQLAlchemy==2.3.2
|
||||||
|
Flask-WTF==0.14.2
|
||||||
|
itsdangerous==0.24
|
||||||
|
Jinja2==2.10
|
||||||
|
MarkupSafe==1.0
|
||||||
|
pluggy==0.6.0
|
||||||
|
py==1.5.2
|
||||||
|
pycparser==2.18
|
||||||
|
pymysql
|
||||||
|
pytest==3.4.1
|
||||||
|
six==1.11.0
|
||||||
|
Werkzeug==0.14.1
|
||||||
|
WTForms==2.1
|
||||||
|
WTForms-Components
|
||||||
|
pymysql_sa
|
||||||
|
Flask-pymysql
|
||||||
|
flask_table
|
||||||
Loading…
Reference in New Issue
Block a user