summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevan Carpenter <devan@taler.net>2024-02-17 12:03:10 -0500
committerDevan Carpenter <devan@taler.net>2024-02-17 12:03:10 -0500
commite6c74d4af2edfca70bb0945695a66ecebf9cdb47 (patch)
tree7467bea7930fcb90fc2f23b1203f9a6164516492
parent02061b7ef3dde0d0d45801cd761712726f0e6f6d (diff)
downloadsandcastle-ng-e6c74d4af2edfca70bb0945695a66ecebf9cdb47.tar.gz
sandcastle-ng-e6c74d4af2edfca70bb0945695a66ecebf9cdb47.tar.bz2
sandcastle-ng-e6c74d4af2edfca70bb0945695a66ecebf9cdb47.zip
ci: update tags for head by fetching commit shas
This makes podman caching work correctly. If the sha hash hasn't changed then cache will be used, and if it has changed, then that component will be built.
-rwxr-xr-xcontrib/ci/jobs/1-build-head/build.sh4
-rwxr-xr-xcontrib/ci/jobs/1-build-head/update-tags.sh22
2 files changed, 23 insertions, 3 deletions
diff --git a/contrib/ci/jobs/1-build-head/build.sh b/contrib/ci/jobs/1-build-head/build.sh
index 3f677bc..a4bde7b 100755
--- a/contrib/ci/jobs/1-build-head/build.sh
+++ b/contrib/ci/jobs/1-build-head/build.sh
@@ -1,9 +1,7 @@
#!/bin/bash
set -exuo pipefail
-for i in buildconfig/*.tag ; do
- echo "master" > "$i"
-done
+./contrib/ci/jobs/1-build-head/update-tags.sh
./sandcastle-build
diff --git a/contrib/ci/jobs/1-build-head/update-tags.sh b/contrib/ci/jobs/1-build-head/update-tags.sh
new file mode 100755
index 0000000..2c7719c
--- /dev/null
+++ b/contrib/ci/jobs/1-build-head/update-tags.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+set -ex
+
+fetch_head() {
+ git ls-remote -q -h "${1}" master | cut -f1
+}
+
+GNUNET_HEAD=$(fetch_head "git://git.gnunet.org/gnunet")
+EXCHANGE_HEAD=$(fetch_head "git://git.taler.net/exchange")
+MERCHANT_HEAD=$(fetch_head "git://git.taler.net/merchant")
+LIBEUFIN_HEAD=$(fetch_head "git://git.taler.net/libeufin")
+MERCHANT_DEMOS_HEAD=$(fetch_head "git://git.taler.net/taler-merchant-demos")
+WALLET_HEAD=$(fetch_head "git://git.taler.net/wallet-core")
+SYNC_HEAD=$(fetch_head "git://git.taler.net/sync")
+
+echo $GNUNET_HEAD > buildconfig/gnunet.tag
+echo $EXCHANGE_HEAD > buildconfig/exchange.tag
+echo $MERCHANT_HEAD > buildconfig/merchant.tag
+echo $LIBEUFIN_HEAD > buildconfig/libeufin.tag
+echo $MERCHANT_DEMOS_HEAD > buildconfig/merchant-demos.tag
+echo $WALLET_HEAD > buildconfig/wallet.tag
+echo $SYNC_HEAD > buildconfig/sync.tag