-
Notifications
You must be signed in to change notification settings - Fork 2
/
justfile
108 lines (92 loc) · 3.66 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
PATH_PHP := "php"
PATH_PYTHON := "python"
PATH_PG := "pg"
PATH_NODE := "node"
DOCKER_UID := env_var_or_default("DOCKER_UID", "1000")
DOCKER_GID := env_var_or_default("DOCKER_GID", "1000")
default:
just --list
# Build PHP 8.x FPM image
build_php_fpm BUILD_VERSION:
#!/usr/bin/env bash
cd {{PATH_PHP}}
echo 'Build PHP:{{BUILD_VERSION}} fpm'
docker build . -t myprod/php:{{BUILD_VERSION}}-fpm --rm --target=fpm --build-arg PHP_VERSION={{BUILD_VERSION}} --build-arg DOCKER_UID={{DOCKER_UID}} --build-arg DOCKER_GID={{DOCKER_GID}}
# Push PHP 8.x FPM image
push_php_fpm BUILD_VERSION:
#!/usr/bin/env bash
cd {{PATH_PHP}}
echo 'Push PHP:{{BUILD_VERSION}} fpm'
docker push myprod/php:{{BUILD_VERSION}}-fpm
# Build PHP 8.x Cli image
build_php_cli BUILD_VERSION:
#!/usr/bin/env bash
cd {{PATH_PHP}}
echo 'Build PHP:{{BUILD_VERSION}} cli'
docker build . -t myprod/php:{{BUILD_VERSION}}-cli --rm --target=cli --build-arg PHP_VERSION={{BUILD_VERSION}} --build-arg DOCKER_UID={{DOCKER_UID}} --build-arg DOCKER_GID={{DOCKER_GID}}
# Push PHP 8.x Cli image
push_php_cli BUILD_VERSION:
#!/usr/bin/env bash
cd {{PATH_PHP}}
echo 'Push PHP:{{BUILD_VERSION}} cli'
docker push myprod/php:{{BUILD_VERSION}}-cli
# Build PHP 8.x dev image
build_php_dev BUILD_VERSION:
#!/usr/bin/env bash
cd {{PATH_PHP}}
echo 'Build PHP:{{BUILD_VERSION}} fpm dev'
docker build . -t myprod/php:{{BUILD_VERSION}}-dev --rm --target=dev --build-arg PHP_VERSION={{BUILD_VERSION}} --build-arg DOCKER_UID={{DOCKER_UID}} --build-arg DOCKER_GID={{DOCKER_GID}}
# Push PHP 8.x dev image
push_php_dev BUILD_VERSION:
#!/usr/bin/env bash
cd {{PATH_PHP}}
echo 'Push PHP:{{BUILD_VERSION}} dev'
docker push myprod/php:{{BUILD_VERSION}}-dev
# Build Python 3.1x images
build_python BUILD_VERSION:
#!/usr/bin/env bash
cd {{PATH_PYTHON}}
echo 'Build Python:{{BUILD_VERSION}}'
docker build . -t myprod/py:{{BUILD_VERSION}} --rm --target=main --build-arg PYTHON_VERSION={{BUILD_VERSION}} --build-arg DOCKER_UID={{DOCKER_UID}} --build-arg DOCKER_GID={{DOCKER_GID}}
# Push Python 3.1x images
push_python BUILD_VERSION:
#!/usr/bin/env bash
cd {{PATH_PYTHON}}
echo 'Push Python:{{BUILD_VERSION}}'
docker push myprod/py:{{BUILD_VERSION}}
# Build PG 14x, 15x, 16x images
build_postgresql BUILD_VERSION:
#!/usr/bin/env bash
cd {{PATH_PG}}
echo 'Build postgres:{{BUILD_VERSION}}'
docker build . -t myprod/db:pg-{{BUILD_VERSION}} --rm --target=postgresql --build-arg PG_VERSION={{BUILD_VERSION}} --build-arg DOCKER_UID={{DOCKER_UID}} --build-arg DOCKER_GID={{DOCKER_GID}}
# Push PG 14x, 15x, 16x images
push_postgresql BUILD_VERSION:
#!/usr/bin/env bash
cd {{PATH_PG}}
echo 'Push Pg:{{BUILD_VERSION}}'
docker push myprod/db:pg-{{BUILD_VERSION}}
# Build Timescale DB 14x, 15x, 16x images
build_timescaledb BUILD_VERSION:
#!/usr/bin/env bash
cd {{PATH_PG}}
echo 'Build Timescale:{{BUILD_VERSION}}'
docker build . -t myprod/db:ts-{{BUILD_VERSION}} --rm --target=timescaledb --build-arg PG_VERSION={{BUILD_VERSION}} --build-arg DOCKER_UID={{DOCKER_UID}} --build-arg DOCKER_GID={{DOCKER_GID}}
# Push Timescale DB 14x, 15x, 16x images
push_timescaledb BUILD_VERSION:
#!/usr/bin/env bash
cd {{PATH_PG}}
echo 'Push Timescale:{{BUILD_VERSION}}'
docker push myprod/db:ts-{{BUILD_VERSION}}
# Build Node images
build_node BUILD_VERSION:
#!/usr/bin/env bash
cd {{PATH_NODE}}
echo 'Build node:{{BUILD_VERSION}}'
docker build . -t myprod/node:{{BUILD_VERSION}} --rm --target=main --build-arg NODE_VERSION={{BUILD_VERSION}} --build-arg DOCKER_UID={{DOCKER_UID}} --build-arg DOCKER_GID={{DOCKER_GID}}
# Push Node images
push_node BUILD_VERSION:
#!/usr/bin/env bash
cd {{PATH_NODE}}
echo 'Push Node:{{BUILD_VERSION}}'
docker push myprod/node:{{BUILD_VERSION}}