forked from sunengine/SunEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-template.sh
More file actions
executable file
·75 lines (46 loc) · 1.8 KB
/
build-template.sh
File metadata and controls
executable file
·75 lines (46 loc) · 1.8 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# ***************************************
# * *
# * BuildProject Script for SunEngine *
# * Script version: 3 *
# * *
# ***************************************
# Note: Build does not contain any config files
# No server Config directory
# No Client/config.js
# You need to upload it manually to the server
# This can be done one time on first deploy
# You need to edit them only if settings changes
# How it works:
# 1. Clear build folder
# 1. Publish server to build folder
# 2. Build client part and copies to wwwroot folder in build folder
# ******* VARIABLES ************************
# Project name. For info only.
PROJECT_NAME="Sun Engine" # replace with you project name
# Paths
# any path can be set to any custom value
# Path to SunEngine solution directory
SOLUTION_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) # Now set to current path
# Can be any path, for example
# SOLUTION_PATH="$HOME/projects/MySite"
# Path to build folder
BUILD_PATH="$SOLUTION_PATH/build"
# Path to client folder
CLIENT_PATH="$SOLUTION_PATH/Client"
# *******************************************
# Define console colors
GREEN='\033[0;32m'
NC='\033[0m' # No Color
echo -e "\n${GREEN}Publishing to directory ${PROJECT_NAME} project$ ${NC}\n"
cd "$SOLUTION_PATH"
echo -e "\n${GREEN}Clearing build ${NC}\n"
rm -r "$BUILD_PATH"
mkdir "$BUILD_PATH"
echo -e "\n${GREEN}Publish build ${PROJECT_NAME} ${NC}\n"
dotnet publish -c Release "$SOLUTION_PATH/SunEngine.Cli" -o "$BUILD_PATH" -v m
echo -e "\n${GREEN}Building Client ${NC}\n"
cd "$CLIENT_PATH"
quasar build
echo -e "\n${GREEN}Copying Client to wwwroot directory ${NC}\n"
cp -r "$CLIENT_PATH/dist/spa/." "$BUILD_PATH/wwwroot"