From 34dac66fc14576d22a770b83c4fe7831d6250d07 Mon Sep 17 00:00:00 2001 From: pat-s Date: Fri, 13 Jun 2025 12:43:47 +0200 Subject: [PATCH] feat: use a single r-version-to-build.txt file --- .crow/build.yaml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.crow/build.yaml b/.crow/build.yaml index abe3097..ca90f57 100644 --- a/.crow/build.yaml +++ b/.crow/build.yaml @@ -97,9 +97,9 @@ steps: image: alpine:3.22 commands: - apk add -q --no-cache curl - - curl -s https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/r/r.rb | grep -o 'R-[0-9]*\.[0-9]*\.[0-9]*' | tr -d 'R-' | tr -d '"' | head -n 1 > r-release-version.txt - - echo "4.2.3" > r-release-version.txt - - cat r-release-version.txt + - curl -s https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/r/r.rb | grep -o 'R-[0-9]*\.[0-9]*\.[0-9]*' | tr -d 'R-' | tr -d '"' | head -n 1 > r-version-to-build.txt + - echo "4.2.3" > r-version-to-build.txt + - cat r-version-to-build.txt backend_options: kubernetes: resources: @@ -128,8 +128,12 @@ steps: image: alpine:3.22 commands: - apk add -q --no-cache aws-cli - - aws s3 ls s3://devxy-r-builds/${PLATFORM_ID}/ | grep ${ARCH_ID} | tail -1 | awk '{print $NF}' | cut -c 3-7 > r_build_latest.txt - - cat r_build_latest.txt + - | + VERSION=$(cat r-version-to-build.txt) + aws s3 ls s3://devxy-r-builds/${PLATFORM_ID}/ | \ + awk -v arch="${ARCH_ID}" -v ver="${VERSION}" \ + '$0 ~ arch && $0 ~ ver {print substr($NF, 3, 5)}' > r-version-s3.txt + - cat r-version-s3.txt backend_options: kubernetes: nodeSelector: @@ -149,10 +153,10 @@ steps: DOCKER_HOST: tcp://docker:2375 commands: | # docker info - if [ ! -s r_build_latest.txt ] || [ ! "$(cat r-release-version.txt)" = "$(cat r_build_latest.txt)" ]; then + if ! grep -qF "$(cat r-version-to-build.txt)" r-version-s3.txt; then apk add -q --no-cache py3-pip make just aws-cli docker-compose pip3 install -q b2 --break-system-packages - just build-r-${PLATFORM} $(cat r-release-version.txt) + just build-r-${PLATFORM} $(cat r-version-to-build.txt) fi backend_options: kubernetes: