forked from datacite/schema
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
62 lines (54 loc) · 1.73 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
language: ruby
rvm:
- 2.6.5
cache: bundler
sudo: required
before_install:
- if [ "${TRAVIS_TAG?}" ]; then
AWS_BUCKET="schema.datacite.org";
RACK_ENV="production";
cp .env.production .env;
else
AWS_BUCKET="schema.stage.datacite.org";
RACK_ENV="stage";
cp .env.stage .env;
fi
- wget https://github.com/jgm/pandoc/releases/download/1.15.2/pandoc-1.15.2-1-amd64.deb
- sudo dpkg -i pandoc-1.15.2-1-amd64.deb
- rm pandoc-1.15.2-1-amd64.deb
install:
- gem install bundler:1.17.3
- bundle install
- sudo pip install awscli
script:
- bundle exec rspec
# - mvn clean test -B -Droot.dir=build/ -Dindex.html=index.html
- bundle exec middleman build -e $RACK_ENV
- bundle exec htmlproofer --http-status-ignore "999,403" --allow-hash-href --only-4xx ./build || true
deploy:
provider: s3
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY
bucket: $AWS_BUCKET
local-dir: build
acl: public_read
skip_cleanup: true
region: eu-west-1
detect_encoding: true
on:
all_branches: true
after_deploy:
- export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY
- export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_KEY
# Allow `awscli` to make requests to CloudFront.
- aws configure set preview.cloudfront true
# Invalidate every object in the targeted distribution.
- if [ "${TRAVIS_TAG?}" ]; then
- aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/*"
else
- aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID_STAGE --paths "/*"
- aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID_TEST --paths "/*"
fi
notifications:
slack: datacite:Wt8En0ALoTA6Kjc5EOKNDWxN
email: false