-
Notifications
You must be signed in to change notification settings - Fork 0
/
importer_jenkins_config.template.sh
52 lines (46 loc) · 1.28 KB
/
importer_jenkins_config.template.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
#!/bin/bash
image_password="test_password"
metadata_requirements_path="metadata_tools/requirements.txt"
python_path=$(pwd)
lockfile="/tmp/importer_jenkins.lock"
setup() {
docker stop mariadb-specify
docker rm mariadb-specify
docker stop picbatch-mysql
docker rm picbatch-mysql
}
cleanup() {
rm -f "$lockfile"
echo "Lockfile removed."
docker stop mariadb-specify
docker rm mariadb-specify
docker stop picbatch-mysql
docker rm picbatch-mysql
echo "DELETE FROM images.images;" | docker exec -i mysql-images mysql -u root -p$image_password
# cleaning up mounted server attachments folder
find ../stable_cas-server/attachments -type f -delete
rm -r venv
# removing tmp pip files
rm -rf /tmp/pip-*
}
replace_https_with_http() {
local file="$1"
if [[ -f "$file" ]]; then
# Replace 'https' with 'http' in place
sed -i.bak 's/https/http/g' "$file"
rm -f "${file}.bak"
echo "Replaced 'https' with 'http' in $file."
else
echo "File $file not found."
fi
}
convert_to_http() {
files=(
"tests/test_server.py"
"views/web_asset_store.xml"
)
# Loop through each file and run the replacement function
for file in "${files[@]}"; do
replace_https_with_http "$file"
done
}