File tree 4 files changed +28
-4
lines changed
charts/factorio-server-charts
4 files changed +28
-4
lines changed Original file line number Diff line number Diff line change 1
1
## Changelog
2
2
3
+ ### V2.4.1
4
+
5
+ #### Non-Breaking Changes
6
+ - Fixing mod download script to encode spaces properly, fixes [ Issue 42] ( https://github.com/SQLJames/factorio-server-charts/issues/42 )
7
+ - Adding update mod check on mod script to avoid it always updating mods, fixes part of[ Issue 45] ( https://github.com/SQLJames/factorio-server-charts/issues/45 )
8
+
3
9
### V2.4.0
4
10
5
11
#### Potentially Breaking Changes
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ sources:
20
20
# This is the chart version. This version number should be incremented each time you make changes
21
21
# to the chart and its templates, including the app version.
22
22
# Versions are expected to follow Semantic Versioning (https://semver.org/)
23
- version : 2.4.0
23
+ version : 2.4.1
24
24
25
25
# This is the version number of the application being deployed. This version number should be
26
26
# incremented each time you make changes to the application. Versions are not expected to
Original file line number Diff line number Diff line change @@ -86,14 +86,21 @@ spec:
86
86
imagePullPolicy : {{ .Values.image.pullPolicy }}
87
87
command :
88
88
- /bin/bash
89
- - -ec
89
+ - -ecx
90
90
- |
91
91
mkdir -p /factorio/mods
92
+ ls -alth /scripts
93
+ echo "Running mod-downloader.sh script..."
92
94
bash /scripts/mod-downloader.sh
95
+ echo "Finished mod-downloader.sh script"
96
+ ls -althR /factorio/mods
93
97
{{- with .Values.podSecurityContext }}
94
98
securityContext :
95
99
{{- toYaml . | nindent 12 }}
96
100
{{- end }}
101
+ env :
102
+ - name : UPDATE_MODS_ON_START
103
+ value : {{ .Values.factorioServer.update_mods_on_start | quote }}
97
104
volumeMounts :
98
105
- name : datadir
99
106
mountPath : /factorio
Original file line number Diff line number Diff line change 11
11
# credit to the factoriotools/factorio-docker team, most of this logic came from them
12
12
# https://github.com/factoriotools/factorio-docker/blob/master/docker/files/update-mods.sh
13
13
mod-downloader.sh : |
14
+ FLAG_FILE="/factorio/mods/.mod_update_complete"
15
+
16
+ # Check if flag file exists and UPDATE_MODS_ON_START is not true
17
+ if [[ -f "$FLAG_FILE" && "${UPDATE_MODS_ON_START}" != "true" ]]; then
18
+ echo "Mod update already completed previously. Skipping."
19
+ exit 0
20
+ fi
14
21
modDir=/factorio/mods
15
22
MOD_BASE_URL="https://mods.factorio.com"
16
23
declare -a officialMods
39
46
cd $modDir;curl -L -o $2 $1
40
47
}
41
48
function downloadofficial() {
49
+ MOD_NAME="$1"
50
+ MOD_NAME_ENCODED="${1// /%20}"
42
51
if [[ -z ${USERNAME:-} ]]; then
43
52
USERNAME="$(cat /account/username)"
44
53
fi
54
63
if [[ -z ${TOKEN:-} ]]; then
55
64
echo "You need to provide your Factorio token to update mods."
56
65
fi
57
- MOD_INFO_URL="$MOD_BASE_URL/api/mods/$1 "
66
+ MOD_INFO_URL="$MOD_BASE_URL/api/mods/$MOD_NAME_ENCODED "
58
67
MOD_INFO_JSON=$(curl --silent "$MOD_INFO_URL")
59
68
# echo "$MOD_INFO_URL $MOD_INFO_JSON"
60
69
if ! echo "$MOD_INFO_JSON" | jq -e .name >/dev/null; then
@@ -107,7 +116,9 @@ data:
107
116
done
108
117
fi
109
118
fi
110
-
119
+ # Mark the update as complete by creating the flag file
120
+ touch "$FLAG_FILE"
121
+ echo "Mod update completed."
111
122
112
123
113
124
You can’t perform that action at this time.
0 commit comments