Skip to content

Commit 9d3acf5

Browse files
committed
Fixed scripts
1 parent 4e48eff commit 9d3acf5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+710
-393
lines changed

.java-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
11

globaltest.sh

Lines changed: 101 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,111 @@
11
#!/bin/bash
22
HAM_MAIN_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
3+
export LANG=en_US.UTF-8
4+
export LC_ALL=$LANG
5+
6+
. $HAM_MAIN_DIR/scripts/libs/version.sh
7+
. $HAM_MAIN_DIR/scripts/libs/runner.sh
8+
9+
function pause {
10+
read -s -n 1 -p "Press any key to continue . . ."
11+
echo ""
12+
}
13+
14+
terminate_ham proxy.run.sh java HttpAnswering
315

416
cd $HAM_MAIN_DIR
517
cd scripts/build
618

19+
if true; then
20+
rm -rf $HAM_MAIN_DIR/release/
721

8-
./build_release.sh
9-
echo build_release $?
10-
GREP_RESULT=$(grep --include=\*.log -rnw "$HAM_MAIN_DIR/release" -e 'ERROR')
11-
if [ -n "$GREP_RESULT" ]
12-
then
13-
echo "Found...errors on ./build_release.sh"
14-
exit 1
15-
fi
1622

17-
./build_release_samples.sh
18-
echo build_release_samples $?
19-
GREP_RESULT=$(grep --include=\*.log -rnw "$HAM_MAIN_DIR/release" -e 'ERROR')
20-
if [ -n "$GREP_RESULT" ]
21-
then
22-
echo "Found...errors on ./build_release_samples.sh"
23-
exit 1
23+
cd $HAM_MAIN_DIR
24+
cd scripts/build
25+
echo [INFO] BEG build_release
26+
./build_release.sh
27+
echo [INFO] END build_release
28+
GREP_RESULT=$(grep --include=\*.log -rnw "$HAM_MAIN_DIR/release" -e 'ERROR')
29+
if [ -n "$GREP_RESULT" ]
30+
then
31+
echo "[ERROR] build_release"
32+
exit 1
33+
fi
34+
35+
echo [INFO] BEG build_release_samples
36+
./build_release_samples.sh
37+
echo [INFO] END build_release_samples
38+
GREP_RESULT=$(grep --include=\*.log -rnw "$HAM_MAIN_DIR/release" -e 'ERROR')
39+
if [ -n "$GREP_RESULT" ]
40+
then
41+
echo "[ERROR] build_release_samples"
42+
exit 1
43+
fi
44+
45+
46+
cd $HAM_MAIN_DIR/release
47+
find "$HAM_MAIN_DIR/release" -name "*.tar.gz" -type f -exec tar xzf {} \;
48+
49+
50+
cd $HAM_MAIN_DIR/release/ham
51+
chmod +x *.sh
52+
cd $HAM_MAIN_DIR/release/calendar
53+
chmod +x *.sh
54+
cd $HAM_MAIN_DIR/release/calendar/scripts
55+
chmod +x *.sh
56+
cd $HAM_MAIN_DIR/release/simpledns
57+
chmod +x *.sh
58+
59+
echo [INFO] BEG ham/local.run.sh
60+
cd $HAM_MAIN_DIR/release/ham
61+
run_till_start 60 local.run.sh http://127.0.0.1/api/health
62+
terminate_app local.run.sh java HttpAnswering
63+
echo [INFO] END ham/local.run.sh
64+
65+
echo [INFO] BEG ham/proxy.run.sh
66+
export http_proxy=http://127.0.0.1:1081
67+
cd $HAM_MAIN_DIR/release/ham
68+
run_till_start 60 proxy.run.sh http://www.local.test/api/health
69+
terminate_app proxy.run.sh java HttpAnswering
70+
unset http_proxy
71+
echo [INFO] END ham/proxy.run.sh
72+
73+
echo [INFO] BEG calendar/scripts/be.sh
74+
cd $HAM_MAIN_DIR/release/calendar/scripts
75+
run_till_start 60 be.sh http://127.0.0.1:8100/api/v1/health
76+
terminate_app be.sh java HttpAnswering
77+
echo [INFO] END calendar/scripts/be.sh
78+
79+
echo [INFO] BEG calendar/scripts/fe.sh
80+
cd $HAM_MAIN_DIR/release/calendar/scripts
81+
run_till_start 60 fe.sh http://127.0.0.1:8080/api/v1/health
82+
terminate_app fe.sh java HttpAnswering
83+
echo [INFO] END calendar/scripts/fe.sh
84+
85+
echo [INFO] BEG calendar/scripts/gateway.sh
86+
cd $HAM_MAIN_DIR/release/calendar/scripts
87+
run_till_start 60 gateway.sh http://127.0.0.1:8090/api/v1/health
88+
terminate_app gateway.sh java HttpAnswering
89+
echo [INFO] END calendar/scripts/gateway.sh
2490
fi
2591

26-
find "$HAM_MAIN_DIR/release" -name "*.tgz" -type f -exec tar xzf {} \;
92+
echo [INFO] BEG calendar/scripts/ham.sh
93+
cd $HAM_MAIN_DIR/release/calendar/scripts
94+
export http_proxy=http://127.0.0.1:1081
95+
run_till_start 60 ham.sh http://www.local.test/api/health
96+
terminate_app ham.sh java HttpAnswering
97+
unset http_proxy
98+
echo [INFO] END calendar/scripts/ham.sh
99+
100+
101+
102+
103+
104+
105+
106+
107+
108+
109+
110+
111+

ham/local.external.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
[
2+
"#include:external/dns.json",
3+
{
4+
"id": "staticPage",
5+
"system": true,
6+
"staticPages": [
7+
]
8+
},
9+
"#include:external/proxy.json",
10+
"#include:external/dbproxy.json",
11+
"#include:external/ssl.json",
12+
"#include:external/http.json",
13+
"#include:external/https.json",
14+
{
15+
"id": "global",
16+
"system": true,
17+
"db": {
18+
"url": "jdbc:h2:tcp://localhost/ham;MODE=MYSQL;",
19+
"login": "sa",
20+
"password": "sa",
21+
"startInternalH2" : true,
22+
"driver": "org.h2.Driver",
23+
"hibernateDialect":"org.hibernate.dialect.MySQLDialect"
24+
},
25+
"localAddress": "127.0.0.1",
26+
"logging": {
27+
"logLevel": "INFO",
28+
"loggers": {
29+
"org.kendar.servers.http.Request": "OFF",
30+
"org.kendar.servers.http.Response": "OFF",
31+
"org.kendar.servers.http.StaticRequest": "OFF",
32+
"org.kendar.servers.http.DynamicRequest": "OFF",
33+
"org.kendar.dns.DnsQueries": "OFF",
34+
"org.kendar.servers.http.InternalRequest": "OFF",
35+
"org.hibernate": "OFF"
36+
}
37+
},
38+
"filters": {
39+
"12363272": false
40+
}
41+
},
42+
{
43+
"id": "oidc.server",
44+
"tokenExpiration": 86400,
45+
"active": false
46+
},
47+
{
48+
"id": "js.filters",
49+
"path": "jsplugins",
50+
"active": true
51+
},
52+
{
53+
"id": "replayer.server",
54+
"path": "replayerdata",
55+
"active": true
56+
},
57+
{
58+
"id": "socks5.server",
59+
"port": 1080,
60+
"httpProxyPort": 1081,
61+
"active": true
62+
}
63+
]

ham/proxy.external.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
"staticPages": [
77
]
88
},
9-
"#include:external/dbproxy.json",
109
"#include:external/proxy.json",
10+
"#include:external/dbproxy.json",
1111
"#include:external/ssl.json",
1212
"#include:external/http.json",
1313
"#include:external/https.json",
1414
{
1515
"id": "global",
1616
"system": true,
17-
"localAddress": "www.local.test",
1817
"db": {
1918
"url": "jdbc:h2:tcp://localhost/ham;MODE=MYSQL;",
2019
"login": "sa",
@@ -23,6 +22,7 @@
2322
"driver": "org.h2.Driver",
2423
"hibernateDialect":"org.hibernate.dialect.MySQLDialect"
2524
},
25+
"localAddress": "www.local.test",
2626
"logging": {
2727

2828
"logLevel": "INFO",

killham.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
HAM_MAIN_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
3+
export LANG=en_US.UTF-8
4+
export LC_ALL=$LANG
5+
6+
. $HAM_MAIN_DIR/scripts/libs/version.sh
7+
. $HAM_MAIN_DIR/scripts/libs/runner.sh
8+
9+
terminate_app java HttpAnsweringMachine
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package org.kendar.be.api.v1;
2+
3+
import org.springframework.web.bind.annotation.GetMapping;
4+
import org.springframework.web.bind.annotation.PathVariable;
5+
import org.springframework.web.bind.annotation.RequestMapping;
6+
import org.springframework.web.bind.annotation.RestController;
7+
8+
@RestController()
9+
@RequestMapping("/api/v1/health")
10+
public class HealthController {
11+
@GetMapping(produces = "text/plain")
12+
String health() {
13+
14+
return "OK";
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package org.kendar.fe;
2+
3+
import org.springframework.web.bind.annotation.GetMapping;
4+
import org.springframework.web.bind.annotation.PathVariable;
5+
import org.springframework.web.bind.annotation.RequestMapping;
6+
import org.springframework.web.bind.annotation.RestController;
7+
8+
@RestController()
9+
@RequestMapping("/api/v1/health")
10+
public class HealthController {
11+
@GetMapping(produces = "text/plain")
12+
String health() {
13+
14+
return "OK";
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package org.kendar.ga.api.v1;
2+
3+
import org.springframework.web.bind.annotation.GetMapping;
4+
import org.springframework.web.bind.annotation.PathVariable;
5+
import org.springframework.web.bind.annotation.RequestMapping;
6+
import org.springframework.web.bind.annotation.RestController;
7+
8+
@RestController()
9+
@RequestMapping("/api/v1/health")
10+
public class HealthController {
11+
@GetMapping(produces = "text/plain")
12+
String health() {
13+
14+
return "OK";
15+
}
16+
}

scripts/build/build_docker.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ START_LOCATION=$(pwd)
99
. $SCRIPT_DIR/libs/utils.sh
1010
. $SCRIPT_DIR/libs/docker.sh
1111

12-
echo This will build the docker images for the application
13-
echo and publish them on local docker. Ctrl+C to exit
14-
echo Target version: $HAM_VERSION
12+
echo [INFO] This will build the docker images for the application
13+
echo [INFO] and publish them on local docker. Ctrl+C to exit
14+
echo [INFO] Target version: $HAM_VERSION
1515

1616
pause
1717

@@ -35,7 +35,7 @@ DNS_HIJACK_SERVER=THEDOCKERNAMEOFTHERUNNINGMASTER
3535

3636
cd $HAM_DIR
3737

38-
echo Building project
38+
echo [INFO] Building project
3939
mvn clean install -DskipTests
4040

4141
cd $DOCKER_ROOT/base
@@ -81,9 +81,9 @@ cd $DOCKER_ROOT/mysql
8181
docker build --rm -t ham.mysql .
8282
docker_push "ham.mysql" "$HAM_VERSION"
8383

84-
echo Cleanup
84+
echo [INFO] Cleanup
8585
cd $HAM_DIR
86-
mvn clean -DskipTests > /dev/null 2>1
86+
mvn clean -DskipTests > /dev/null 2>&1
8787

8888
# Restore previous dir
8989
cd $START_LOCATION

scripts/build/build_docker_samples.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ START_LOCATION=$(pwd)
99
. $SCRIPT_DIR/libs/utils.sh
1010
. $SCRIPT_DIR/libs/docker.sh
1111

12-
echo This will build the docker images for the samples
13-
echo and publish them on local docker. Ctrl+C to exit
14-
echo Target version: $HAM_VERSION
12+
echo [INFO] This will build the docker images for the samples
13+
echo [INFO] and publish them on local docker. Ctrl+C to exit
14+
echo [INFO] Target version: $HAM_VERSION
1515

1616
pause
1717

@@ -25,7 +25,7 @@ PASSWORD=none
2525
# Extra initializations
2626
ROOT_DIR=$( cd -- "$( dirname -- "$SCRIPT_DIR" )" &> /dev/null && pwd )
2727

28-
echo Build calendar sample images
28+
echo [INFO] Build calendar sample images
2929
cd $ROOT_DIR/samples/calendar/docker/multi
3030
docker build --rm -t ham.sampleapp.multi -f multimaster.Dockerfile ../../
3131
docker_push "ham.sampleapp.multi" "$HAM_VERSION"
@@ -40,7 +40,7 @@ cd $ROOT_DIR/samples/calendar/docker/single
4040
docker build -t ham.sampleapp.single -f Dockerfile ../../
4141
docker_push "ham.sampleapp.single" "$HAM_VERSION"
4242

43-
echo Build quotes sample images
43+
echo [INFO] Build quotes sample images
4444
cd $ROOT_DIR/samples/quotes/docker/multi
4545
docker build --rm -t ham.quotes.master -f multimaster.Dockerfile ../../
4646
docker_push "ham.quotes.master" "$HAM_VERSION"

scripts/build/build_release.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,39 @@ START_LOCATION=$(pwd)
88
. $SCRIPT_DIR/libs/version.sh
99
. $SCRIPT_DIR/libs/utils.sh
1010

11-
echo This will build a tar.gz to run the application. Ctrl+C to exit
12-
echo Target version: $HAM_VERSION
11+
echo [INFO] This will build a tar.gz to run the application. Ctrl+C to exit
12+
echo [INFO] Target version: $HAM_VERSION
1313

1414

1515
# Extra initializations
1616
ROOT_DIR=$( cd -- "$( dirname -- "$SCRIPT_DIR" )" &> /dev/null && pwd )
1717

1818
# Setup the target directory
19-
echo Setup target dir
19+
echo [INFO] Setup target dir
2020
HAM_RELEASE_TARGET=$ROOT_DIR/release/$HAM_VERSION
2121
rm -rf $HAM_RELEASE_TARGET || true
2222
mkdir -p $HAM_RELEASE_TARGET
2323

2424
# Build HAM
2525
cd $ROOT_DIR/ham
26-
echo Building ham
27-
mvn clean install -DskipTests > "$ROOT_DIR"/release/ham-"$HAM_VERSION".log 2>1
26+
echo [INFO] Building ham
27+
mvn clean install -DskipTests > "$ROOT_DIR"/release/ham-"$HAM_VERSION".log 2>&1
2828

2929

3030

3131
# Copy result
32-
echo Copying result to target
32+
echo [INFO] Copying result to target
3333
. $SCRIPT_DIR/build/libs/copy_ham.sh
3434
. $SCRIPT_DIR/build/libs/copy_simpledns.sh
3535
# Prepare the run commands
3636

3737
# Prepare the compressed file
38-
echo Compress release file
38+
echo [INFO] Compress release file
3939
cd $ROOT_DIR/release/$HAM_VERSION
40-
tar -zcvf "$ROOT_DIR"/release/ham-"$HAM_VERSION".tar.gz . >> "$ROOT_DIR"/release/ham-"$HAM_VERSION".log 2>1
40+
tar -zcvf "$ROOT_DIR"/release/ham-"$HAM_VERSION".tar.gz . >> "$ROOT_DIR"/release/ham-"$HAM_VERSION".log 2>&1
4141

4242
# Cleanup
43-
echo Cleanup
43+
echo [INFO] Cleanup
4444
rm -rf $HAM_RELEASE_TARGET || true
4545

4646
# Restore previous dir

0 commit comments

Comments
 (0)