Skip to content
This repository has been archived by the owner on Aug 21, 2021. It is now read-only.

Commit

Permalink
Setup to build docker images on TravisCI
Browse files Browse the repository at this point in the history
  • Loading branch information
spiermar committed Jan 23, 2017
1 parent fa23cc3 commit 25dfde6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 23 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Expand Up @@ -11,3 +11,7 @@ insert_final_newline = true


[*.md] [*.md]
trim_trailing_whitespace = false trim_trailing_whitespace = false

[Makefile]
indent_style = tab
indent_size = 1
10 changes: 8 additions & 2 deletions .travis.yml
@@ -1,9 +1,15 @@
language: node_js language: node_js
node_js: node_js:
- "0.10" - "4.7.2"
before_script: before_script:
- npm install -g gulp - npm install -g gulp
- npm install -g bower - npm install -g bower
- npm install - npm install
- bower 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="
28 changes: 7 additions & 21 deletions Dockerfile
Expand Up @@ -15,33 +15,19 @@
FROM alpine:latest FROM alpine:latest
MAINTAINER Martin Spier <mspier@netflix.com> MAINTAINER Martin Spier <mspier@netflix.com>


# version = git branch/tag, e.g. master, stable, tags/1.1.0, ... RUN mkdir -p /usr/share/nginx/html
ENV VECTOR_VERSION=tags/v1.1.0 COPY /dist /usr/share/nginx/html

RUN apk add --update curl && \
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 / && \
curl --silent --show-error --fail --location \ curl --silent --show-error --fail --location \
--header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \ --header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \
"https://caddyserver.com/download/build?os=linux&arch=amd64" \ "https://caddyserver.com/download/build?os=linux&arch=amd64" \
| tar --no-same-owner -C /usr/bin/ -xz caddy && \ | tar --no-same-owner -C /usr/bin/ -xz caddy && \
chmod 0755 /usr/bin/caddy && \ chmod 0755 /usr/bin/caddy && \
/usr/bin/caddy -version && \ /usr/bin/caddy -version && \
npm uninstall -g gulp bower && \ apk del curl && \
apk del git nodejs curl && \ rm -rf /root/.cache /root/.config /root/.local /root/.ash_history \
rm -rf /root/.npm /root/.cache /root/.config /root/.local /root/.ash_history \ /usr/share/man /var/cache/apk/*
/root/.v8flags* /usr/share/man /tmp/* /var/cache/apk/* \
/usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm*


EXPOSE 80 EXPOSE 80
CMD ["/usr/bin/caddy", "-root", "/usr/share/nginx/html", "-port", "80"] CMD ["/usr/bin/caddy", "-root", "/usr/share/nginx/html", "-port", "80"]
VOLUME ["/usr/share/nginx/html"] VOLUME ["/usr/share/nginx/html"]
12 changes: 12 additions & 0 deletions Makefile
@@ -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.