Skip to content

Commit f4a8c76

Browse files
committed
chore: use just to release instead of custom script
1 parent 91afd9d commit f4a8c76

File tree

2 files changed

+29
-26
lines changed

2 files changed

+29
-26
lines changed

Diff for: devops/release.sh

-26
This file was deleted.

Diff for: justfile

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
docker-cmd := "docker"
2+
docker-compose-cmd := "docker compose"
3+
4+
release:
5+
#!/usr/bin/env bash
6+
set -eu
7+
8+
if [[ $(git branch --show-current) != "main" ]]; then
9+
echo "You must run the release script on the main branch" >&2
10+
exit 1
11+
fi
12+
13+
base_date_tag=$(date +%y.%m)
14+
last_tag=$(git tag | sort -r | grep "${base_date_tag}" | head -n 1)
15+
last_tag_revision=$(echo "${last_tag}" | cut -d . -f 3 -)
16+
new_tag_revision=$((last_tag_revision+1))
17+
new_tag="${base_date_tag}.${new_tag_revision}"
18+
19+
echo "Creating version ${new_tag} Press enter to accept."
20+
read -r
21+
22+
{{docker-cmd}} pull python:3.12-slim-bookworm
23+
{{docker-compose-cmd}} -f production.yml build --build-arg "VERSION=${new_tag}" django
24+
{{docker-cmd}} image tag legadilo_production_django:latest "rg.fr-par.scw.cloud/legadilo/legadilo-django:${new_tag}"
25+
{{docker-cmd}} image tag legadilo_production_django:latest rg.fr-par.scw.cloud/legadilo/legadilo-django:latest
26+
{{docker-cmd}} image push "rg.fr-par.scw.cloud/legadilo/legadilo-django:${new_tag}"
27+
{{docker-cmd}} image push rg.fr-par.scw.cloud/legadilo/legadilo-django:latest
28+
git tag "${new_tag}"
29+
git push --tags --no-verify

0 commit comments

Comments
 (0)