Annotate

tools/build-env/build.sh @ 13732:1465b1e305df 13.0

mod_admin_shell, util.prosodyctl.shell: Process command-line args on server-side, with argparse support This allow a shell-command to provide a 'flags' field, which will automatically cause the parameters to be fed through argparse. The rationale is to make it easier for more complex commands to be invoked from the command line (`prosodyctl shell foo bar ...`). Until now they were limited to accepting a list of strings, and any complex argument processing was non-standard and awkward to implement.
author Matthew Wild <mwild1@gmail.com>
date Mon, 17 Feb 2025 17:02:35 +0000
parent 13403:0369f6986824
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13323
7bfd6db52528 tools/build-env: Tools for building and testing in a container
Kim Alvefur <zash@zash.se>
parents:
diff changeset
1 #!/bin/sh -eux
7bfd6db52528 tools/build-env: Tools for building and testing in a container
Kim Alvefur <zash@zash.se>
parents:
diff changeset
2
7bfd6db52528 tools/build-env: Tools for building and testing in a container
Kim Alvefur <zash@zash.se>
parents:
diff changeset
3 cd "$(dirname "$0")"
7bfd6db52528 tools/build-env: Tools for building and testing in a container
Kim Alvefur <zash@zash.se>
parents:
diff changeset
4
13403
0369f6986824 tools: Fix selection of container engine
Kim Alvefur <zash@zash.se>
parents: 13323
diff changeset
5 containerify="$(command -v podman || command -v docker)"
0369f6986824 tools: Fix selection of container engine
Kim Alvefur <zash@zash.se>
parents: 13323
diff changeset
6
0369f6986824 tools: Fix selection of container engine
Kim Alvefur <zash@zash.se>
parents: 13323
diff changeset
7 if [ -z "$containerify" ]; then
0369f6986824 tools: Fix selection of container engine
Kim Alvefur <zash@zash.se>
parents: 13323
diff changeset
8 echo "podman or docker required" >&2
0369f6986824 tools: Fix selection of container engine
Kim Alvefur <zash@zash.se>
parents: 13323
diff changeset
9 exit 1
0369f6986824 tools: Fix selection of container engine
Kim Alvefur <zash@zash.se>
parents: 13323
diff changeset
10 fi
13323
7bfd6db52528 tools/build-env: Tools for building and testing in a container
Kim Alvefur <zash@zash.se>
parents:
diff changeset
11
7bfd6db52528 tools/build-env: Tools for building and testing in a container
Kim Alvefur <zash@zash.se>
parents:
diff changeset
12 $containerify build -f ./Containerfile --squash \
7bfd6db52528 tools/build-env: Tools for building and testing in a container
Kim Alvefur <zash@zash.se>
parents:
diff changeset
13 --build-arg os="${2:-debian}" \
7bfd6db52528 tools/build-env: Tools for building and testing in a container
Kim Alvefur <zash@zash.se>
parents:
diff changeset
14 --build-arg dist="${1:-testing}" \
7bfd6db52528 tools/build-env: Tools for building and testing in a container
Kim Alvefur <zash@zash.se>
parents:
diff changeset
15 -t "prosody.im/build-env:${1:-testing}"
7bfd6db52528 tools/build-env: Tools for building and testing in a container
Kim Alvefur <zash@zash.se>
parents:
diff changeset
16