-
Notifications
You must be signed in to change notification settings - Fork 3
/
Justfile
74 lines (62 loc) · 1.93 KB
/
Justfile
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# the output directory for the documentation
docsDir := "site"
# describes available recipes
help:
just --list --unsorted
# wipe local caches
clean:
rm -rf {{docsDir}} docs/repos
############################
# Release
############################
release version:
#!/usr/bin/env bash
# validate currently on main
branch="$(git branch --show-current)"
if [[ ! "${branch}" == "main" ]]; then
echo "You can only cut a release from the 'main' branch."
echo "Currently on branch '${branch}'"
exit 1
fi
# validate currently in main repository
origin=$(git remote get-url origin)
if [[ ! "${origin}" == "https://github.com/boozallen/mkdocs-yamp-plugin" ]]; then
echo "You must publish from the source repository"
echo "Currently origin = ${origin}"
exit 1
fi
# update the release version on the main branch
hatch version {{version}}
git add yamp/__init__.py
version=$(hatch version)
git commit -m "bumping version to ${version}"
git push
# cut a release branch and cut a release tag
git checkout -B release/$version
git push --set-upstream origin release/$version
git tag $version
git push origin refs/tags/$version
# publish the release to pypi
source .pypi.env
hatch build
hatch publish -r main
# bump to rc candidate
git checkout main
hatch version patch,rc
version=$(hatch version)
git add yamp/__init__.py
git commit -m "bump release to ${version}"
git push
############################
# Documentation Recipes
############################
# builds the jte docs builder image
docsImage := "docs-builder"
buildDocsImage:
docker build . -t {{docsImage}}
# Build the jte documentation
docs: buildDocsImage
docker run --rm -v $(pwd)/..:/docs -w /docs/$(basename $(pwd)) {{docsImage}} build
# serve the docs locally for development
serve: buildDocsImage
docker run --rm -p 8000:8000 -v $(pwd)/..:/docs -w /docs/$(basename $(pwd)) {{docsImage}} serve -a 0.0.0.0:8000