Attempt reduce build / test times with travis cache #58

This commit is contained in:
Michael Mayer 2018-11-09 10:56:52 +01:00
parent 7c559a21ab
commit 18f88b8a2f
5 changed files with 17 additions and 10 deletions

View file

@ -1,5 +1,9 @@
sudo: required
cache:
directories:
- $HOME/.cache
services:
- docker

View file

@ -1,4 +1,4 @@
FROM photoprism/development:20181108
FROM photoprism/development:20181109
# Set up project directory
WORKDIR "/go/src/github.com/photoprism/photoprism"

View file

@ -31,7 +31,7 @@ install-config:
build:
scripts/build.sh
js:
(cd frontend && yarn install --prod)
(cd frontend && yarn install --frozen-lockfile --prod)
(cd frontend && env NODE_ENV=production npm run build)
start:
$(GORUN) cmd/photoprism/photoprism.go start

View file

@ -5,6 +5,9 @@ services:
build: .
image: photoprism/photoprism:develop
command: tail -f /dev/null
volumes:
- ~/.cache/yarn:/root/.cache/yarn
- ~/.cache/go-mod:/go/pkg/mod
environment:
- CODECOV_TOKEN
- CODECOV_ENV

View file

@ -2,6 +2,7 @@ FROM ubuntu:18.04
LABEL maintainer="Michael Mayer <michael@liquidbytes.net>"
# Install dev / build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
@ -51,6 +52,7 @@ RUN apt-get update && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install Go
ENV GOLANG_VERSION 1.11.2
RUN set -eux; \
\
@ -62,12 +64,11 @@ RUN set -eux; \
export PATH="/usr/local/go/bin:$PATH"; \
go version
# Configure Go environment
ENV GOPATH /go
ENV GOBIN $GOPATH/bin
ENV PATH $GOBIN:/usr/local/go/bin:$PATH
ENV GO111MODULE on
ENV NODE_ENV production
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
# Download TensorFlow model and test files
@ -78,16 +79,15 @@ RUN wget "https://www.dropbox.com/s/na9p9wwt98l7m5b/import.zip?dl=1" -O /tmp/pho
# Install goimports
RUN env GO111MODULE=off /usr/local/go/bin/go get golang.org/x/tools/cmd/goimports
# Configure JS environment for building
ENV NODE_ENV production
ENV YARN_CACHE_FOLDER /root/.cache/yarn
# Set up project directory
WORKDIR "/go/src/github.com/photoprism/photoprism"
# Get PhotoPrism dependencies
COPY . .
RUN make dep
RUN rm -rf /go/src/github.com/photoprism/photoprism
# Expose HTTP port
EXPOSE 80
# Start PhotoPrism server
# Keep container running (services can be started manually using a terminal)
CMD tail -f /dev/null