new file: Dockerfile

new file:   Jenkinsfile
	new file:   UTC
	new file:   start.sh
This commit is contained in:
Jonathan Ervine 2020-07-09 22:51:25 +08:00
parent c1287d9e45
commit 060913c6ae
4 changed files with 62 additions and 0 deletions

27
Dockerfile Normal file
View File

@ -0,0 +1,27 @@
# 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
# Create mediaservice user
ENV LANG='en_US.UTF-8' \
LANGUAGE='en_US.UTF-8' \
TERM='xterm'
RUN echo http://dl-4.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \
apk update && \
apk -U upgrade && \
apk -U add \
python git py-pillow
ADD UTC /etc/localtime
RUN git clone https://github.com/Hellowlol/HTPC-Manager && \
rm -rf /var/cache/apk/*
COPY start.sh /usr/local/bin/start.sh
EXPOSE 8085
CMD [ "/usr/local/bin/start.sh" ]

27
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,27 @@
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-htpcmgr", credentialsId: 'jenkins-to-gogs'
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/htpc-mgr"
stage "publish"
app.push("${env.BUILD_NUMBER}")
app.push("latest")
stage('Deploy on K8s'){
sh "/usr/local/bin/kubectl -n media delete po htpc-0"
}
}
catch (err) {
currentBuild.result = 'FAILURE'
}
}
}

BIN
UTC Normal file

Binary file not shown.

8
start.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
#
## Script to kick off HTPC Manager
#
addgroup -g $GID $USER
adduser -D -u $UID -G $USER -H $USER
chown -R $UID:$GID /HTPC-Manager
su - $USER -c "/usr/bin/python /HTPC-Manager/Htpc.py --datadir=/config"