From 46ee666437daaa2bc16c81a9208f75751358ebc2 Mon Sep 17 00:00:00 2001 From: tim Date: Thu, 15 Jul 2021 02:12:19 +0200 Subject: [PATCH] Add deploy script and move some vars to env file for prod and local --- .env.development | 2 ++ .env.production | 2 ++ deploy.sh | 3 +++ src/services/PerudoApi.ts | 2 +- src/views/Home.vue | 2 +- 5 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .env.development create mode 100644 .env.production create mode 100755 deploy.sh diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..4046146 --- /dev/null +++ b/.env.development @@ -0,0 +1,2 @@ +VUE_APP_BASE_URL=http://localhost:8000/ +VUE_APP_NAME=Bobby \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..ceb4f76 --- /dev/null +++ b/.env.production @@ -0,0 +1,2 @@ +VUE_APP_BASE_URL=https://perudo.loken.nl/ +VUE_APP_NAME= \ No newline at end of file diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..73aa196 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,3 @@ +#!/usr/bin/sh +npm run build +scp -r dist/* www-data@cemophora:/var/www/perudo-client.loken.nl/ diff --git a/src/services/PerudoApi.ts b/src/services/PerudoApi.ts index f786858..7dddbd5 100644 --- a/src/services/PerudoApi.ts +++ b/src/services/PerudoApi.ts @@ -2,7 +2,7 @@ import axios, {AxiosPromise, AxiosResponse} from 'axios' import {JoinCreateGameObject, IsStartedObject, ApiObject, GameStateObject, MyTurnObject, GuessAction} from "@/objects/objects"; export default class PerudoApi { - private static baseUrl = 'http://localhost:8000/' + private static baseUrl = process.env.VUE_APP_BASE_URL; private static objectInstance?: PerudoApi; diff --git a/src/views/Home.vue b/src/views/Home.vue index fccf069..ddc9ccc 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -112,7 +112,7 @@ export default class Home extends Vue { private gameStateObject: GameStateObject | null = null; private error: string | null = null; - private name: string = 'Bobby'; + private name: string = process.env.VUE_APP_NAME; private code: string = ''; private owner: boolean = false;