test for multistage build

This commit is contained in:
Nils Stinnesbeck 2019-11-23 00:17:15 +01:00
parent a768496858
commit b4b9d42bf4
Signed by: nils
GPG Key ID: 86D4882C6C6CA48B
2 changed files with 26 additions and 32 deletions

View File

@ -1,37 +1,12 @@
kind: pipeline kind: pipeline
name: meshviewer build name: meshviewer build
clone:
depth: 50
steps: steps:
# - name: clone git - name: docker
# image: docker:git image: plugins/docker
# commands: settings:
# - git submodule update --recursive --init repo: fftdf/meshviewer
target: meshviewer
- name: build on node 12 username: from_secret: docker_username
image: node:12.12.0-stretch password: from_secret: docker_password
commands:
- node --version
- npm --version
- yarn --version
- pwd
- ls -alh
- npm i gulp-cli -g
- yarn
- gulp
# - name: backup-old-firmware
# image: appleboy/drone-ssh
# settings:
# host: 46.4.138.183
# username: fwupload
# key:
# from_secret: ssh-update
# port: 22
# command_timeout: 120m
# script:
# - ./rsync-backup.sh
# - rm -rf /srv/fwuploads/troisdorf/*

19
Dockerfile Normal file
View File

@ -0,0 +1,19 @@
# builder
FROM node:12.12.0-stretch as builder
# show versions
RUN node --version && npm --version && yarn --version
# install gulp
RUN npm i gulp-cli -g
# run yarn for prerequisits
RUN yarn
# run gulp to build app
RUN gulp
# build docker container
FROM nginx:1.17.6-alpine as meshviewer
COPY --from=builder /drone/src/build /usr/share/nginx/html/