Permalink
Browse files

Setup to build docker images on TravisCI

  • Loading branch information...
spiermar committed Jan 23, 2017
1 parent fa23cc3 commit 25dfde6444ed6e67ac11ad74137736d5be582fd8
Showing with 31 additions and 23 deletions.
  1. +4 −0 .editorconfig
  2. +8 −2 .travis.yml
  3. +7 −21 Dockerfile
  4. +12 −0 Makefile
View
@@ -11,3 +11,7 @@ insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
[Makefile]
indent_style = tab
indent_size = 1
View
@@ -1,9 +1,15 @@
language: node_js
node_js:
- "0.10"
- "4.7.2"
before_script:
- npm install -g gulp
- npm install -g bower
- npm install
- bower install
script: gulp clean build
script: make build
services:
- docker
env:
global:
- secure: "VBGA/BGX7MPQ+h0OyAssRvIpyMN4rWk8CyBxvL1mgw43iLZYEo6PYEGtXWnMBxgh9NMT5oymkU6PsvRfVbCbpAIdJHGe7fbM1xK7wRd8OS6VpRJWFcwVeyE56qat+I/KSnYrQ4eJTZ6Ii3h3otoDRfW5RLrw2VHRZ+//Hr6sgVY="
- secure: "FDsSnzJEwnYJ6OQEA8MuxFuWMAcAI6pR6hRCWIpSzDK1gk2xx3tG0m39WijAUiLmUF8GxrpB1h0dmXpvbG1OHNLC97m273Qr8jAXIzHU3HqJ0BhL4sT+gPIDYf2stbYTZMieGQM8yC/OQWIckpJThEqtoGWHSJAzmQyEJmNbidg="
View
@@ -15,33 +15,19 @@
FROM alpine:latest
MAINTAINER Martin Spier <mspier@netflix.com>
# version = git branch/tag, e.g. master, stable, tags/1.1.0, ...
ENV VECTOR_VERSION=tags/v1.1.0
RUN apk add --update git nodejs curl && \
cd /tmp && \
git clone https://github.com/Netflix/vector.git && \
cd vector && \
git checkout ${VECTOR_VERSION} && \
npm install && \
npm install -g gulp bower && \
bower install --allow-root && \
gulp build && \
mkdir -p /usr/share/nginx/html && \
mv dist/* /usr/share/nginx/html && \
cd / && \
RUN mkdir -p /usr/share/nginx/html
COPY /dist /usr/share/nginx/html
RUN apk add --update curl && \
curl --silent --show-error --fail --location \
--header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \
"https://caddyserver.com/download/build?os=linux&arch=amd64" \
| tar --no-same-owner -C /usr/bin/ -xz caddy && \
chmod 0755 /usr/bin/caddy && \
/usr/bin/caddy -version && \
npm uninstall -g gulp bower && \
apk del git nodejs curl && \
rm -rf /root/.npm /root/.cache /root/.config /root/.local /root/.ash_history \
/root/.v8flags* /usr/share/man /tmp/* /var/cache/apk/* \
/usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm*
apk del curl && \
rm -rf /root/.cache /root/.config /root/.local /root/.ash_history \
/usr/share/man /var/cache/apk/*
EXPOSE 80
CMD ["/usr/bin/caddy", "-root", "/usr/share/nginx/html", "-port", "80"]
VOLUME ["/usr/share/nginx/html"]
VOLUME ["/usr/share/nginx/html"]
View
@@ -0,0 +1,12 @@
build:
gulp clean
gulp build
@if [ "$TRAVIS" == "true" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then \
docker build -t netflixoss/vector . ; \
if [ "$TRAVIS_TAG" != "" ]; then \
docker tag netflixoss/vector:latest netflixoss/vector:$TRAVIS_TAG; \
fi; \
docker images; \
docker login -u=${dockerhubUsername} -p=${dockerhubPassword}; \
docker push netflixoss/vector; \
fi

0 comments on commit 25dfde6

Please sign in to comment.