Initial commit

This commit is contained in:
Jonathan Ervine 2020-07-24 10:15:26 +08:00
parent b03171597b
commit 06faadb3a4
2 changed files with 55 additions and 0 deletions

19
Dockerfile Normal file
View File

@ -0,0 +1,19 @@
FROM node:14.5.0-alpine3.12 as build-deps
WORKDIR /usr/src/build
COPY package*.json ./
COPY . .
RUN npm install && npm run build
FROM node:14.5.0-alpine3.12
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install --only=production
COPY --from=build-deps /usr/src/build/dist /usr/src/app/dist
COPY public/ ./public
ENV NODE_ENV "production"
EXPOSE 3000
CMD [ "node", "dist/server.js" ]

36
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,36 @@
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-slack2chat.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/slack2chat:14.5.0'
}
}
}
}