From deb516b9d8385c9c1b7b5ffb7a88dd041d5d825e Mon Sep 17 00:00:00 2001 From: Piumal Rathnayake Date: Thu, 20 May 2021 06:37:01 +0530 Subject: [PATCH] Update travis script to trigger the backend deployment (#154) --- .travis.yml | 11 ++++++++++- src/constants.ts | 6 +++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 69972dd..affe9ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,4 +6,13 @@ cache: - node_modules script: - npm run build - - npm run lint + - npm run lint +after_script: + - | + if [[ ($TRAVIS_BRANCH == $FRONTEND_DEPLOY_BRANCH ) && ($TRAVIS_PULL_REQUEST == false) ]]; then + curl -LO --retry 3 https://raw.githubusercontent.com/plume-lib/trigger-travis/master/trigger-travis.sh + sh trigger-travis.sh --branch $BACKEND_DEPLOY_BRANCH $BACKEND_GITHUB_ID $BACKEND_REPO_ID $TRAVIS_ACCESS_TOKEN + else + echo "Backend deployment did not run" + fi + diff --git a/src/constants.ts b/src/constants.ts index 2445cf3..a332619 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,3 +1,3 @@ -export const API_URL = 'http://localhost:8080/api'; -export const AUTH_URL = 'http://localhost:8080/login'; -export const LOGOUT_URL = 'http://localhost:8080/logout'; +export const API_URL = '/api'; +export const AUTH_URL = '/login'; +export const LOGOUT_URL = '/logout';