-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
upgrade.sh
28 lines (22 loc) · 959 Bytes
/
upgrade.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
#!/usr/bin/env sh
# Get latest version from screeps github repository
# version=$(curl https://raw.githubusercontent.com/screeps/screeps/master/package.json | jq -r .version)
version=$(docker run -it --rm --name jq endeveit/docker-jq sh -c 'curl -s https://raw.githubusercontent.com/screeps/screeps/master/package.json | jq -r .version')
# Clone our repository
git clone [email protected]:QNimbus/docker-screeps.git
# Push CWD onto stack and cd into repository directory
pushd docker-screeps
# Update version number in Dockerfile and create/update timestamp
sed -i 's/^ENV SCREEPS_VERSION.*$/ENV SCREEPS_VERSION '$version'/i' Dockerfile
date > timestamp
git add timestamp
# Commit, tag and push updated repository
git commit -a -m "Auto Update to screeps "$version
git tag -f $version
if [[ "$version" != "ptr" ]]; then
git tag -f latest
fi
git push origin main --tags --force
# Go back to original folder and remove repository
popd
rm -rf docker-screeps