Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 31d55d7

Browse filesBrowse files
committed
feat: start adding tags with new versions
1 parent c37d6b8 commit 31d55d7
Copy full SHA for 31d55d7

File tree

2 files changed

+41
-2
lines changed
Filter options

2 files changed

+41
-2
lines changed

‎scripts/update_dockerfile.sh

Copy file name to clipboard
+11-2Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
#!/usr/bin/env bash
22

3+
echo "Fetching latest Bookstack release from GitHub API"
4+
35
BOOKSTACK_VERSION=$(curl -L \
46
-H "Accept: application/vnd.github+json" \
57
-H "X-GitHub-Api-Version: 2022-11-28" \
68
https://api.github.com/repos/BookstackApp/Bookstack/releases/latest | \
79
jq -r .tag_name
810
)
911

10-
echo "Latest: ${BOOKSTACK_VERSION}. Updating.."
12+
echo "Found latest version: ${BOOKSTACK_VERSION}"
13+
14+
# Get the root of the Git repository in order to correctly path e.g. Dockerfile
15+
GIT_ROOT=$(git rev-parse --show-toplevel)
1116

17+
echo "Updating Dockerfile.."
1218
sed \
1319
-i '' \
1420
-e "s/^ENV BOOKSTACK_VERSION=.*/ENV BOOKSTACK_VERSION=${BOOKSTACK_VERSION}/" \
15-
Dockerfile
21+
"${GIT_ROOT}/Dockerfile"
22+
23+
git add "${GIT_ROOT}/Dockerfile"
24+
git commit -S -m "feat: update Dockerfile to use Bookstack ${BOOKSTACK_VERSION}"

‎scripts/update_tags_and_docs.sh

Copy file name to clipboard
+30Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
3+
# Get the root of the Git repository in order to correctly path e.g. Dockerfile
4+
GIT_ROOT=$(git rev-parse --show-toplevel)
5+
6+
# Extract the version from the Dockerfile, as there could have been a new
7+
# release since the last run.
8+
9+
BOOKSTACK_VERSION=$(awk \
10+
'/ENV BOOKSTACK_VERSION/{split($2,b,"="); print b[2]}' \
11+
"${GIT_ROOT}/Dockerfile"
12+
)
13+
14+
echo "Extracted version: ${BOOKSTACK_VERSION}"
15+
16+
# Remove the 'v' for our tags
17+
BOOKSTACK_VERSION="${BOOKSTACK_VERSION/#v/}"
18+
# Remove leading zeros to make the version fit a SemVer-shaped hole
19+
BOOKSTACK_VERSION="${BOOKSTACK_VERSION/.0/.}"
20+
# And again for patch version, just in case
21+
BOOKSTACK_VERSION="${BOOKSTACK_VERSION/.0/.}"
22+
23+
echo "Tag name: ${BOOKSTACK_VERSION}"
24+
25+
git tag -s -a "${BOOKSTACK_VERSION}" -m "Release version ${BOOKSTACK_VERSION}"
26+
git push --tags
27+
28+
# TODO: Sort VERSION file
29+
# TODO: Update README version
30+
# TODO: Update docker-compose

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.