diff options
author | Devan Carpenter <devan@taler.net> | 2023-09-11 11:09:48 -0400 |
---|---|---|
committer | Devan Carpenter <devan@taler.net> | 2023-09-11 12:26:23 -0400 |
commit | d118ffb88b393f0ab2c2d534486d5651186fcd92 (patch) | |
tree | e2ae19f0e4a0a8e161fbd3fbf3dff2669be3bbe1 /ci/ci.sh | |
parent | cc27750a79d8d4dbbedaa0dfcf21fe21a7464936 (diff) | |
download | wallet-core-d118ffb88b393f0ab2c2d534486d5651186fcd92.tar.xz |
ci: add script for running CI locally
Diffstat (limited to 'ci/ci.sh')
-rwxr-xr-x | ci/ci.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ci/ci.sh b/ci/ci.sh new file mode 100755 index 000000000..fc523d8f5 --- /dev/null +++ b/ci/ci.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -evuo pipefail + +# Use podman if available, otherwise use docker. +# Fails if neither is found in PATH +OCI_RUNTIME=$(which podman || which docker) +REPO_NAME=$(basename "${PWD}") +JOB_NAME="${1}" +JOB_CONTAINER=$((grep CONTAINER_NAME ci/jobs/${JOB_NAME}/config.ini | cut -d' ' -f 3) || echo "${REPO_NAME}") + +echo "${JOB_CONTAINER}" + +if [ "${JOB_CONTAINER}" = "${REPO_NAME}" ] ; then + "${OCI_RUNTIME}" build \ + -t "${JOB_CONTAINER}" \ + -f ci/Containerfile . +fi + +"${OCI_RUNTIME}" run \ + --rm \ + -ti \ + --volume "${PWD}":/workdir \ + --workdir /workdir \ + "${JOB_CONTAINER}" \ + ci/jobs/"${JOB_NAME}"/job.sh + +top_dir=$(dirname "${BASH_SOURCE[0]}") + +#"${top_dir}"/build.sh |