-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathdocker-build.sh
More file actions
executable file
·54 lines (44 loc) · 1.37 KB
/
Copy pathdocker-build.sh
File metadata and controls
executable file
·54 lines (44 loc) · 1.37 KB
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
#!/usr/bin/env bash
# Copyright (c) 2026 Code Infinity
# SPDX-License-Identifier: MPL-2.0
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Build and push tina4stack/tina4-python Docker images after a release.
#
# Usage:
# ./docker-build.sh # builds :v3 and :v3.10.98 (reads version from source)
# ./docker-build.sh 3.10.99 # override version tag
#
# Prerequisites:
# docker login (must be authenticated to tina4stack org on Docker Hub)
set -euo pipefail
REPO="tina4stack/tina4-python"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# Resolve version from argument or source
if [ -n "${1:-}" ]; then
VERSION="$1"
else
VERSION=$(grep '__version__' "$SCRIPT_DIR/tina4_python/__init__.py" | sed 's/.*"\(.*\)".*/\1/')
fi
if [ -z "$VERSION" ]; then
echo "ERROR: Could not determine version. Pass it as an argument: ./docker-build.sh 3.10.98"
exit 1
fi
echo "Building $REPO"
echo " Tags: v3, v$VERSION"
echo ""
# Build with both tags
docker build \
-t "$REPO:v3" \
-t "$REPO:v$VERSION" \
"$SCRIPT_DIR"
echo ""
echo "Pushing $REPO:v3 ..."
docker push "$REPO:v3"
echo "Pushing $REPO:v$VERSION ..."
docker push "$REPO:v$VERSION"
echo ""
echo "Done. Images pushed:"
echo " $REPO:v3"
echo " $REPO:v$VERSION"