forked from games-on-k8s/docker-factorio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_release.sh
More file actions
executable file
·39 lines (33 loc) · 898 Bytes
/
Copy pathmake_release.sh
File metadata and controls
executable file
·39 lines (33 loc) · 898 Bytes
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
#!/usr/bin/env bash
set -e
VERSION=$1
if [ -z ${VERSION} ]
then
echo "Packages an arbitrary Factorio release."
echo
echo "Usage: $0 0.15.34"
exit 1
fi
LOCAL_FILENAME=factorio_headless_x64_${VERSION}.tar.xz
DOWNLOAD_URL=https://www.factorio.com/get-download/${VERSION}/headless/linux64
# Attempt to grab the requested release.
wget ${DOWNLOAD_URL} -O ${LOCAL_FILENAME} || rm -f ${LOCAL_FILENAME}
if [ $? -ne 0 ]
then
exit 1
fi
docker build --build-arg factorio_version=${VERSION} \
-t quay.io/oxyrox/factorio-k8s:${VERSION} .
docker run --rm -it quay.io/oxyrox/factorio-k8s:${VERSION}
while true; do
read -p "Publish the built image? (y/n) " yn
case $yn in
[Yy]* )
docker push quay.io/oxyrox/factorio-k8s:${VERSION}
break;;
[Nn]* )
exit;;
* )
echo "Please answer y or n.";;
esac
done