forked from spryker-sdk/load-testing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·62 lines (53 loc) · 1.41 KB
/
install.sh
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
#!/bin/bash
GATLING_DOWNLOAD_MAVEN_URL='https://repo1.maven.org/maven2/io/gatling/highcharts/gatling-charts-highcharts-bundle/3.3.0/gatling-charts-highcharts-bundle-3.3.0-bundle.zip'
GATLING_ARCHIVE_NAME='gatling-charts-highcharts-bundle-3.3.0-bundle.zip'
GATLING_DIRECTORY_NAME='gatling-charts-highcharts-bundle-3.3.0'
function installNpm() {
npm i
}
function cleanUpGatling() {
rm -r ./.dist/${GATLING_DIRECTORY_NAME}/ 2>/dev/null
rm -r ./gatling 2>/dev/null
rm ./.dist/*.zip 2>/dev/null
}
function downloadGatling() {
curl ${GATLING_DOWNLOAD_MAVEN_URL} --output ./.dist/${GATLING_ARCHIVE_NAME}
}
function unpackGatling() {
unzip -q ./.dist/${GATLING_ARCHIVE_NAME} -d ./.dist
rm ./.dist/${GATLING_ARCHIVE_NAME} 2>/dev/null
rm -r ./gatling 2>/dev/null
cp -R -n ./.dist/${GATLING_DIRECTORY_NAME} ./gatling/
}
function saveGatlingConfig() {
if [ -d './gatling/conf' ]; then
rm -rf ./.dist/gatling-conf 2>/dev/null
mkdir ./.dist/gatling-conf
cp -R -n ./gatling/conf/* ./.dist/gatling-conf
fi
}
function loadGatlingConfig() {
if [ -d './.dist/gatling-conf' ]; then
rm -rf ./gatling/conf 2>/dev/null
mv ./.dist/gatling-conf ./gatling/conf
fi
}
function installGatling() {
saveGatlingConfig
cleanUpGatling
downloadGatling
unpackGatling
loadGatlingConfig
}
case "${1}" in
gatling)
installGatling
;;
npm)
installNpm
;;
*)
installGatling
installNpm
;;
esac