forked from mamba-org/micromamba-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.sh
executable file
·32 lines (24 loc) · 822 Bytes
/
update.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
#!/bin/bash
set -euf -o pipefail
if [[ $# -ne 1 ]]; then
echo "Usage: $0 version"
exit 1
fi
VERSION="$1"
BRANCH="release${VERSION}"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
DOCKERFILES=$(find . -not -path "./test/bats/*" -name '*Dockerfile')
git checkout main
git pull
git checkout -b "$BRANCH"
for f in $DOCKERFILES; do
sed -i.bak "s%^FROM mambaorg/micromamba:.*$%FROM mambaorg/micromamba:${VERSION}%" "$f"
rm "$f.bak"
done
sed -i.bak "s%mambaorg/micromamba:.*$%mambaorg/micromamba:${VERSION}%" "${SCRIPT_DIR}/README.md"
rm "${SCRIPT_DIR}/README.md.bak"
git add README.md $DOCKERFILES
git commit -m "micromamba v${VERSION}"
git push --set-upstream origin "$BRANCH"
git tag -a "v${VERSION}" -m "micromamba v${VERSION}"
git push --set-upstream origin "$BRANCH" --tags