Closed eliasstepanik closed 1 month ago
I don't thinks this will work. update.sh needs to be adjusted.
I don't thinks this will work. update.sh needs to be adjusted.
Worked for me. But I will have a look if there is some adjustment needed.
Yeah but you are not github actions running update.sh and overwriting docker-compose.yml and buildinfo.json when you run.
stable_sha256=$(curl "https://factorio.com/download/sha256sums/" | grep "factorio_headless_x64_${stable_online_version}.tar.xz" | awk '{print $1}')
experimental_sha256=$(curl "https://factorio.com/download/sha256sums/" | grep "factorio_headless_x64_${experimental_online_version}.tar.xz" | awk '{print $1}')
e6a64a9ee5b1d3773cd1f40aa5cf78e91960eade6c508fd365c34752afdf2762 factorio-headless_linux_2.0.7.tar.xz
Need to fix the filename
Need to fix the filename
But only from 1.2.0 onward. That's the hard part im hung up on rn.
No need the script only take new version and from my understanding, they will never release any 1.... version. The game (without the DLC) will be keep in the 2... core. If I am wrong, we can fix it later.
Can't we do a simple condition then, considering they'll probably keep the new naming scheme from now on ? Or do we want to do some regex shanenigans to look for headless
and 2.x.x
?
This greps using both styles of string, in case they go back and forth:
curl "https://factorio.com/download/sha256sums/" | grep -E "factorio_headless_x64_${stable_online_version}.tar.xz|factorio-headless_linux_${stable_online_version}.tar.xz" | awk '{print $1}'
curl "https://factorio.com/download/sha256sums/" | grep -E "(factorio_headless_x64_|factorio-headless_linux_)${stable_online_version}.tar.xz" | awk '{print $1}'
Tell when I can merge
Nice code cleaning/commenting and fix at the same time
Needs testing!
Could you revert the commits of the hardcoded SHAs though
At the moment I am still working so could somebody test the update.sh.
At the moment I am still working so could somebody test the update.sh.
Let it run for 5min. Does not seem to be exiting. Gets to after sha256 sum retrieve step then hangs.
Output:
after fetch
after sha256
modified with debug output:
#!/bin/bash
set -e
SEMVER_REGEX="^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
# Fetch online stable and experimental versions
stable_online_version=$(curl -s 'https://factorio.com/api/latest-releases' | jq '.stable.headless' -r)
experimental_online_version=$(curl -s 'https://factorio.com/api/latest-releases' | jq '.experimental.headless' -r)
echo "after fetch"
# Fetch SHA256 checksums
stable_sha256=$(curl -s "https://factorio.com/get-download/${stable_online_version}/headless/linux64" | grep "factorio_headless_x64_${stable_online_version}.tar.xz" | awk '{print $1}')
experimental_sha256=$(curl -s "https://factorio.com/get-download/${experimental_online_version}/headless/linux64" | grep "factorio_headless_x64_${experimental_online_version}.tar.xz" | awk '{print $1}')
echo "after sha256"
# Current versions in buildinfo.json
stable_current_version=$(jq -r 'with_entries(select(contains({value:{tags:["stable"]}}))) | keys | .[0]' buildinfo.json)
latest_current_version=$(jq -r 'with_entries(select(contains({value:{tags:["latest"]}}))) | keys | .[0]')
echo "from buildinfo"
# Output version information
echo "stable_online_version=${stable_online_version} experimental_online_version=${experimental_online_version}"
echo "stable_current_version=${stable_current_version} latest_current_version=${latest_current_version}"
echo "after version match"
At the moment I am still working so could somebody test the update.sh.
I can confirm that it is not working, looking at fixes now
yq: -i/--in-place can only be used with -y/-Y
now this happens
Sadly I don't have anymore time today. I hope you can resolve the Problems.
https://github.com/factoriotools/factorio-docker/pull/505 ? seem the good fixes ?
Thinking we might need to move to: https://github.com/factoriotools/factorio-docker/pull/505
I merged #505 for a quick fix, but I would like to see this change as well, because of the cleanup. There are conflicts now, but these should be small.
I merged #505 for a quick fix, but I would like to see this change as well, because of the cleanup. There are conflicts now, but these should be small.
Yes but it will be better to just have an MR with the cleanup. Here, we clean also the .json file.
I am positive the hash you use is a hash of the factorio headless bundle, not the docker container. Docker build job failed.Nevermind :)