Skip to content

Commit aadf4fe

Browse files
author
Chris Maunder
committed
Adjusting relative locations to the main CodeProject.AI Server repo
1 parent eb07ec5 commit aadf4fe

5 files changed

Lines changed: 30 additions & 23 deletions

File tree

Docker/push_docker.bat

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
@echo off
1414
setlocal enabledelayedexpansion
1515

16+
REM The location of the root of the server repo relative to this script
17+
set repo_base=..\..\CodeProject.AI-Server-Private
18+
1619
REM Sniff Parameters
1720

1821
set do_all=false
@@ -59,17 +62,17 @@ echo Pushing: !images!
5962

6063

6164
REM Get Version: We're building for the current server version
62-
for /f "usebackq tokens=2 delims=:," %%a in (`findstr /I /R /C:"\"Major\"[^^{]*$" "..\..\src\server\version.json"`) do (
65+
for /f "usebackq tokens=2 delims=:," %%a in (`findstr /I /R /C:"\"Major\"[^^{]*$" "!repo_base!\src\server\version.json"`) do (
6366
set "major=%%a"
6467
set major=!major:"=!
6568
set major=!major: =!
6669
)
67-
for /f "usebackq tokens=2 delims=:," %%a in (`findstr /I /R /C:"\"Minor\"[^^{]*$" "..\..\src\server\version.json"`) do (
70+
for /f "usebackq tokens=2 delims=:," %%a in (`findstr /I /R /C:"\"Minor\"[^^{]*$" "!repo_base!\src\server\version.json"`) do (
6871
set "minor=%%a"
6972
set minor=!minor:"=!
7073
set minor=!minor: =!
7174
)
72-
for /f "usebackq tokens=2 delims=:," %%a in (`findstr /I /R /C:"\"Patch\"[^^{]*$" "..\..\src\server\version.json"`) do (
75+
for /f "usebackq tokens=2 delims=:," %%a in (`findstr /I /R /C:"\"Patch\"[^^{]*$" "!repo_base!\src\server\version.json"`) do (
7376
set "patch=%%a"
7477
set patch=!patch:"=!
7578
set patch=!patch: =!

Docker/push_docker.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
# rpi - push Raspberry Pi image
1414
#
1515

16+
# The location of the root of the server repo relative to this script
17+
repo_base="../../CodeProject.AI-Server-Private"
18+
1619
# Sniff Parameters
1720

1821
do_all=false
@@ -58,12 +61,9 @@ echo "Pushing: ${images}"
5861

5962
# Get Version: We're building for the current server version
6063

61-
# This script
62-
SCRIPT_PATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
63-
64-
MAJOR=$(grep -o '"Major"\s*:\s*[^,}]*' "${SCRIPT_PATH}/../../src/server/version.json" | sed 's/.*: \(.*\)/\1/')
65-
MINOR=$(grep -o '"Minor"\s*:\s*[^,}]*' "${SCRIPT_PATH}/../../src/server/version.json" | sed 's/.*: \(.*\)/\1/')
66-
PATCH=$(grep -o '"Patch"\s*:\s*[^,}]*' "${SCRIPT_PATH}/../../src/server/version.json" | sed 's/.*: \(.*\)/\1/')
64+
MAJOR=$(grep -o '"Major"\s*:\s*[^,}]*' "${"${repo_base}/src/server/version.json" | sed 's/.*: \(.*\)/\1/')
65+
MINOR=$(grep -o '"Minor"\s*:\s*[^,}]*' "${"${repo_base}/src/server/version.json" | sed 's/.*: \(.*\)/\1/')
66+
PATCH=$(grep -o '"Patch"\s*:\s*[^,}]*' "${"${repo_base}/src/server/version.json" | sed 's/.*: \(.*\)/\1/')
6767
VERSION="${MAJOR}.${MINOR}.${PATCH}"
6868
6969

Ubuntu/build_installer.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ INSTALLER_DIRNAME="installer"
2323

2424
### Parameters
2525

26-
# This script
27-
SCRIPT_PATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
26+
# The location of the root of the server repo relative to this script
27+
repo_base="../../CodeProject.AI-Server-Private"
2828

2929
# Utilities
30-
source "${SCRIPT_PATH}/../../src/SDK/Scripts/utils.sh"
30+
source "${repo_base}/src/SDK/Scripts/utils.sh"
3131

3232
# The path, relative to the root of the install, used to launch the application
3333
# eg "myapp" or "server/myserver". A shortcut to /usr/local/bin will be created
@@ -37,9 +37,9 @@ APPLICATION_FILE_PATH="server/CodeProject.AI.Server.dll"
3737
PRODUCT="CodeProject.AI Server"
3838

3939
# We're building for the current server version
40-
MAJOR=$(grep -o '"Major"\s*:\s*[^,}]*' "${SCRIPT_PATH}/../../src/server/version.json" | sed 's/.*: \(.*\)/\1/')
41-
MINOR=$(grep -o '"Minor"\s*:\s*[^,}]*' "${SCRIPT_PATH}/../../src/server/version.json" | sed 's/.*: \(.*\)/\1/')
42-
PATCH=$(grep -o '"Patch"\s*:\s*[^,}]*' "${SCRIPT_PATH}/../../src/server/version.json" | sed 's/.*: \(.*\)/\1/')
40+
MAJOR=$(grep -o '"Major"\s*:\s*[^,}]*' "${repo_base}/src/server/version.json" | sed 's/.*: \(.*\)/\1/')
41+
MINOR=$(grep -o '"Minor"\s*:\s*[^,}]*' "${repo_base}/src/server/version.json" | sed 's/.*: \(.*\)/\1/')
42+
PATCH=$(grep -o '"Patch"\s*:\s*[^,}]*' "${repo_base}/src/server/version.json" | sed 's/.*: \(.*\)/\1/')
4343
VERSION="${MAJOR}.${MINOR}.${PATCH}"
4444

4545
# For places where we need no spaces (eg identifiers)

Windows/Inno Setup/build_inno.bat

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
@echo off
2+
23
set starttime=%time%
4+
5+
REM The location of the root of the server repo relative to this script
6+
set repo_base=..\..\..\CodeProject.AI-Server-Private
7+
38
:: go to the solution root.
4-
:: we should currently be at "<solution-root>\Installers\Windows\Inno Setup"
5-
pushd ..\..\..
9+
pushd repo_base
610

711
:: make sure that the code is up to date
812
echo.

macOS/build_installer.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ INSTALLER_DIRNAME="installer"
2323

2424
### Parameters
2525

26-
# This script
27-
SCRIPT_PATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
26+
# The location of the root of the server repo relative to this script
27+
repo_base="../../CodeProject.AI-Server-Private"
2828

2929
# Utilities
30-
source "${SCRIPT_PATH}/../../src/SDK/Scripts/utils.sh"
30+
source "${repo_base}/src/SDK/Scripts/utils.sh"
3131

3232
# The path, relative to the root of the install, used to launch the application
3333
# eg "myapp" or "server/myserver". A shortcut to /usr/local/bin will be created
@@ -37,9 +37,9 @@ APPLICATION_FILE_PATH="server/CodeProject.AI.Server.dll"
3737
PRODUCT="CodeProject.AI Server"
3838

3939
# We're building for the current server version
40-
MAJOR=$(grep -o '"Major"\s*:\s*[^,}]*' "${SCRIPT_PATH}/../../src/server/version.json" | sed 's/.*: \(.*\)/\1/')
41-
MINOR=$(grep -o '"Minor"\s*:\s*[^,}]*' "${SCRIPT_PATH}/../../src/server/version.json" | sed 's/.*: \(.*\)/\1/')
42-
PATCH=$(grep -o '"Patch"\s*:\s*[^,}]*' "${SCRIPT_PATH}/../../src/server/version.json" | sed 's/.*: \(.*\)/\1/')
40+
MAJOR=$(grep -o '"Major"\s*:\s*[^,}]*' "${"${repo_base}/src/server/version.json" | sed 's/.*: \(.*\)/\1/')
41+
MINOR=$(grep -o '"Minor"\s*:\s*[^,}]*' "${"${repo_base}/src/server/version.json" | sed 's/.*: \(.*\)/\1/')
42+
PATCH=$(grep -o '"Patch"\s*:\s*[^,}]*' "${"${repo_base}/src/server/version.json" | sed 's/.*: \(.*\)/\1/')
4343
VERSION="${MAJOR}.${MINOR}.${PATCH}"
4444
4545
# For places where we need no spaces (eg identifiers)

0 commit comments

Comments
 (0)