-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
28 lines (28 loc) · 1.23 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
language: node_js
node_js:
- node
script:
- npm run lint
- npm run coverage
- npm run typescript
- npm run build
- echo "Folder name in Digital Ocean Spaces - $TRAVIS_COMMIT"
- mkdir -p dist/@openmrs/esm-patient-chart/$TRAVIS_COMMIT
- mv dist/*.* dist/@openmrs/esm-patient-chart/$TRAVIS_COMMIT/
deploy:
provider: s3
access_key_id: "$DIGITAL_OCEAN_SPACES_KEY_ID"
secret_access_key: "$DIGITAL_OCEAN_SPACES_ACCESS_KEY"
bucket: "$DIGITAL_OCEAN_SPACES_BUCKET"
endpoint: "$DIGITAL_OCEAN_SPACES_ENDPOINT"
cache-control: "max-age=31536000"
local_dir: dist
skip_cleanup: true
acl: public_read
on:
branch: master
after_deploy:
- echo "Updating import map to point to new version of @openmrs/esm-patient-chart"
- statuscode=$(curl --output /dev/null --write-out %{http_code} -u $DEPLOYER_USERNAME:$DEPLOYER_PASSWORD -d '{ "service":"@openmrs/esm-patient-chart","url":"https://spa-modules.nyc3.digitaloceanspaces.com/@openmrs/esm-patient-chart/'$TRAVIS_COMMIT'/openmrs-esm-patient-chart.js" }' -X PATCH $DEPLOYER_HOST/services\?env=prod -H "Accept:application/json" -H "Content-Type:application/json")
- echo "Deployment Status Code --> ${statuscode}"
- if [ "$statuscode" -ne 200 ]; then travis_terminate "$statuscode"; fi