Merge pull request '3.11.3' (#1) from 3.11.3 into master
Reviewed-on: #1
This commit is contained in:
commit
dc1238b563
24
Dockerfile
Normal file
24
Dockerfile
Normal file
@ -0,0 +1,24 @@
|
||||
# Base on latest (edge) alpine image
|
||||
FROM node:10-alpine
|
||||
MAINTAINER Sven Fischer <sven@leiderfischer.de>
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
RUN apk add --no-cache --virtual .build-deps \
|
||||
git python make g++ \
|
||||
&& apk add --no-cache openssh-client \
|
||||
&& git clone https://github.com/krishnasrinivas/wetty --branch master /src \
|
||||
&& npm install \
|
||||
&& apk del .build-deps \
|
||||
&& adduser -h /src -D term \
|
||||
&& npm run-script build
|
||||
|
||||
ADD run.sh /src
|
||||
|
||||
# Default ENV params used by wetty
|
||||
ENV REMOTE_SSH_SERVER=127.0.0.1 \
|
||||
REMOTE_SSH_PORT=22
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
ENTRYPOINT "./run.sh"
|
||||
28
Jenkinsfile
vendored
Normal file
28
Jenkinsfile
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
node("docker-node") {
|
||||
docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') {
|
||||
|
||||
git branch: "3.11.3", url: "ssh://git@git.ervine.org/jonny/x86_64-alpine-wetty", 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/wetty"
|
||||
|
||||
stage "publish"
|
||||
app.push("${env.BUILD_NUMBER}")
|
||||
app.push("latest")
|
||||
app.push("master")
|
||||
app.push("1.3")
|
||||
|
||||
stage('Deploy on K8s'){
|
||||
sh "/usr/local/bin/kubectl -n wetty delete po --all"
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
currentBuild.result = 'FAILURE'
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
# x86_64-alpine-wetty
|
||||
|
||||
weTTY running on Alpine Linux container image
|
||||
Configured to connect to specified server name via environment variable (taken from https://github.com/svenihoney/docker-wetty-alpine)
|
||||
weTTY running on Alpine Linux container image
|
||||
Configured to connect to specified server name via environment variable (taken from https://github.com/svenihoney/docker-wetty-alpine)
|
||||
|
||||
17
run.sh
Executable file
17
run.sh
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "x${BASE}" == "x" ]; then
|
||||
BASE="/"
|
||||
fi
|
||||
|
||||
if [ "x${REMOTE_SSH_SERVER}" == "x" ]; then
|
||||
# Login mode, no SSH_SERVER
|
||||
npm start -- -p 3000
|
||||
else
|
||||
# SSH connect mode
|
||||
cmd="npm start -- -p 3000 --sshhost ${REMOTE_SSH_SERVER} --sshport ${REMOTE_SSH_PORT} --base ${BASE}"
|
||||
if ! [ "x${REMOTE_SSH_USER}" == "x" ]; then
|
||||
cmd="${cmd} --sshuser ${REMOTE_SSH_USER}"
|
||||
fi
|
||||
su -c "${cmd}" term
|
||||
fi
|
||||
Loading…
Reference in New Issue
Block a user