Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
45 lines (39 sloc) 1.33 KB
sudo: required
services:
- docker
before_install:
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
- docker --version
- docker build -t trafex/clipboard-backend -f Dockerfile-backend .
- docker build -t trafex/clipboard-frontend -f Dockerfile-frontend .
script:
- docker run -t --rm trafex/clipboard-frontend yarn lint
- docker run --rm trafex/clipboard-frontend yarn test-coverage
- docker run -t --rm -v `pwd`/build:/usr/src/app/build trafex/clipboard-frontend yarn build
- docker run -d trafex/clipboard-backend
- docker run -d trafex/clipboard-frontend
- docker ps -a
deploy:
- provider: s3
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY
bucket: "clipboard.ninja"
skip_cleanup: true
local_dir: build
region: "eu-west-1"
# Upload static files again, but now with the correct cache-control header
- provider: s3
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY
bucket: "clipboard.ninja"
skip_cleanup: true
local_dir: build/static
upload-dir: static
region: "eu-west-1"
cache_control: "max-age=31536000"
after_success:
- if [ "$TRAVIS_BRANCH" == "master" ]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
docker push trafex/clipboard-backend:latest;
fi