-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpg-build-remote-all
executable file
·68 lines (55 loc) · 2.15 KB
/
pg-build-remote-all
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
#!/bin/sh
set -e
set -u
g_build_tag="${1:-$(hostname)}"
g_pg_ver="${2:-17.2}"
fn_build_native_aarch64_macos() {
rm -rf ~/postgresql-* || true
rm -rf ~/postgres-* || true
rm -rf ~/psql-* || true
pg-build "${g_build_tag}" "${g_pg_ver}"
mv ~/postgresql-*.tar.gz ~/Downloads/tmp/"pg-builder-${g_pg_ver}"/
mv ~/postgres-*.tar.gz ~/Downloads/tmp/"pg-builder-${g_pg_ver}"/
mv ~/psql-*.tar.gz ~/Downloads/tmp/"pg-builder-${g_pg_ver}"/
}
fn_build_x86_64_macos() {
pg-build-remote pg-build-x86-64-macos "${g_build_tag}" "${g_pg_ver}"
rsync -avhPz pg-build-x86-64-macos:~/'p*'.tar.gz ~/Downloads/tmp/"pg-builder-${g_pg_ver}"/
}
fn_build_aarch64_musl() {
pg-build-remote pg-build-aarch64-linux-musl "${g_build_tag}" "${g_pg_ver}"
rsync -avhPz pg-build-aarch64-linux-musl:~/'p*'.tar.gz ~/Downloads/tmp/"pg-builder-${g_pg_ver}"/
}
fn_build_aarch64_gnu() {
pg-build-remote pg-build-aarch64-linux-gnu "${g_build_tag}" "${g_pg_ver}"
rsync -avhPz pg-build-aarch64-linux-gnu:~/'p*'.tar.gz ~/Downloads/tmp/"pg-builder-${g_pg_ver}"/
}
fn_build_x86_64_gnu() {
pg-build-remote pg-build-x86-64-linux-gnu "${g_build_tag}" "${g_pg_ver}"
rsync -avhPz pg-build-x86-64-linux-gnu:~/'p*'.tar.gz ~/Downloads/tmp/"pg-builder-${g_pg_ver}"/
}
fn_build_x86_64_musl() {
pg-build-remote pg-build-x86-64-linux-musl "${g_build_tag}" "${g_pg_ver}"
rsync -avhPz pg-build-x86-64-linux-musl:~/'p*'.tar.gz ~/Downloads/tmp/"pg-builder-${g_pg_ver}"/
}
fn_test_connectivity() {
ssh pg-build-x86-64-macos 'echo "Hello, x86_64 macOS!"'
ssh pg-build-aarch64-linux-gnu 'echo "Hello, aarch64 GNU/Linux!"'
ssh pg-build-aarch64-linux-musl 'echo "Hello, aarch64 Linux (musl)!"'
ssh pg-build-x86-64-linux-gnu 'echo "Hello, x86_64 GNU/Linux!"'
ssh pg-build-x86-64-linux-musl 'echo "Hello, x86_64 Linux (musl)!"'
}
mkdir -p ~/Downloads/tmp/"pg-builder-${g_pg_ver}"/
fn_test_connectivity
echo ""
echo "Check success for ^^"
echo ""
sleep 10
fn_build_x86_64_gnu &
fn_build_x86_64_musl &
fn_build_x86_64_macos &
fn_build_native_aarch64_macos &
# sequentially, because these are virtualized on the same machine
fn_build_aarch64_musl
fn_build_aarch64_gnu
wait