diff options
author | Devan Carpenter <devan@taler.net> | 2024-01-15 12:51:59 -0500 |
---|---|---|
committer | Devan Carpenter <devan@taler.net> | 2024-01-15 12:53:15 -0500 |
commit | 06e76f52e5b0c54d87ce02919de6e800686b0ffa (patch) | |
tree | 7ea9e34917892d99d8ee622b8eb256d1666c3b89 /contrib | |
parent | 579dec5ba4b1e18952cd507078aad349163e1026 (diff) | |
download | wallet-core-06e76f52e5b0c54d87ce02919de6e800686b0ffa.tar.xz |
ci: update local run script
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/ci/ci.sh | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/contrib/ci/ci.sh b/contrib/ci/ci.sh index fc523d8f5..0719015b9 100755 --- a/contrib/ci/ci.sh +++ b/contrib/ci/ci.sh @@ -1,28 +1,33 @@ #!/bin/bash -set -evuo pipefail +set -exvuo pipefail -# Use podman if available, otherwise use docker. -# Fails if neither is found in PATH -OCI_RUNTIME=$(which podman || which docker) +# Requires podman +# Fails if not found in PATH +OCI_RUNTIME=$(which podman) 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}") +JOB_ARCH=$((grep CONTAINER_ARCH contrib/ci/jobs/${JOB_NAME}/config.ini | cut -d' ' -f 3) || echo "${2:-amd64}") +JOB_CONTAINER=$((grep CONTAINER_NAME contrib/ci/jobs/${JOB_NAME}/config.ini | cut -d' ' -f 3) || echo "localhost/${REPO_NAME}:${JOB_ARCH}") +CONTAINER_BUILD=$((grep CONTAINER_BUILD contrib/ci/jobs/${JOB_NAME}/config.ini | cut -d' ' -f 3) || echo "True") -echo "${JOB_CONTAINER}" +echo "Image name: ${JOB_CONTAINER}" -if [ "${JOB_CONTAINER}" = "${REPO_NAME}" ] ; then +if [ "${CONTAINER_BUILD}" = "True" ] ; then "${OCI_RUNTIME}" build \ + --arch "${JOB_ARCH}" \ -t "${JOB_CONTAINER}" \ - -f ci/Containerfile . + -f contrib/ci/Containerfile . fi "${OCI_RUNTIME}" run \ --rm \ -ti \ + --arch "${JOB_ARCH}" \ + --env CI_COMMIT_REF="$(git rev-parse HEAD)" \ --volume "${PWD}":/workdir \ --workdir /workdir \ "${JOB_CONTAINER}" \ - ci/jobs/"${JOB_NAME}"/job.sh + contrib/ci/jobs/"${JOB_NAME}"/job.sh top_dir=$(dirname "${BASH_SOURCE[0]}") |