Publish ui from within dockerfile

This commit is contained in:
Tom Gallacher 2017-01-03 15:46:20 +00:00
parent 26d3b82703
commit 0eb7ef6860
3 changed files with 12 additions and 3 deletions

View File

@ -32,7 +32,7 @@ deployment:
branch: master branch: master
commands: commands:
- ./bin/docker-login - ./bin/docker-login
- make -C ui publish - make -C ui publish | sed '/NPM_TOKEN/d'
- make -j2 build - make -j2 build
- make -j2 push - make -j2 push
- ./bin/deploy - ./bin/deploy

10
ui/Dockerfile.build Normal file
View File

@ -0,0 +1,10 @@
FROM quay.io/yldio/alpine-node-containerpilot:latest
ARG NPM_TOKEN
ARG CIRCLE_BUILD_NUM
ENV NPM_TOKEN ${NPM_TOKEN}
ENV CIRCLE_BUILD_NUM ${CIRCLE_BUILD_NUM}
RUN echo -e "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
RUN NODE_ENV=production make compile
RUN make install
RUN npm version 0.0.1-${CIRCLE_BUILD_NUM}
RUN npm publish --tag alpha --access public

View File

@ -68,5 +68,4 @@ lint-ci:
.PHONY: publish .PHONY: publish
publish: publish:
npm version 0.0.1-$(CIRCLE_BUILD_NUM) docker build --build-arg NPM_TOKEN=${NPM_TOKEN} --build-arg CIRCLE_BUILD_NUM=${CIRCLE_BUILD_NUM} -f Dockerfile.build .
npm publish --tag alpha --access public