generated from fatmali/openmrs-esm-home
-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
28 lines (28 loc) · 1.25 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 test
- npm run typescript
- npm run build
- echo "Folder name in Digital Ocean Spaces - $TRAVIS_COMMIT"
- mkdir -p dist/@ampath/esm-patient-chart-widgets/$TRAVIS_COMMIT
- mv dist/*.* dist/@ampath/esm-patient-chart-widgets/$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_TEST"
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 @ampath/esm-patient-chart-widgets"
- statuscode=$(curl --output /dev/null --write-out %{http_code} -u $DEPLOYER_USERNAME:$DEPLOYER_PASSWORD -d '{ "service":"@ampath/esm-patient-chart-widgets","url":"'$IMPORT_MAP_FILE_PREFIX_TEST'/@ampath/esm-patient-chart-widgets/'$TRAVIS_COMMIT'/ampath-esm-patient-chart-widgets.js" }' -X PATCH $DEPLOYER_HOST/services\?env=test -H "Accept:application/json" -H "Content-Type:application/json")
- echo "Deployment Status Code --> ${statuscode}"
- if [ "$statuscode" -ne 200 ]; then travis_terminate "$statuscode"; fi