diff --git a/dockerfiles/ci-unified/Dockerfile b/dockerfiles/ci-unified/Dockerfile index 59503e91..263bfc55 100644 --- a/dockerfiles/ci-unified/Dockerfile +++ b/dockerfiles/ci-unified/Dockerfile @@ -8,6 +8,7 @@ ARG RESTIC_VERSION="0.16.1" ARG RUST_STABLE_VERSION="1.75.0" ARG RUST_NIGHTLY_VERSION="2024-01-22" ARG LLVM_VERSION="15" +ARG FORKLIFT_VERSION="latest" ARG MINIO_VERSION="2023-04-06T16-51-10Z" ARG RUSTC_RV32E_TOOLCHAIN_TAG="v1.1.0" ARG RUSTC_RV32E_TOOLCHAIN_VERSION="nightly-2024-01-05" @@ -289,6 +290,16 @@ RUN wget -q https://github.com/paritytech/rustc-rv32e-toolchain/releases/downloa mv rve-nightly /usr/local/rustup/toolchains && \ rm -f rust-rve-${RUSTC_RV32E_TOOLCHAIN_VERSION}-x86_64-unknown-linux-gnu.tar.zst + +### forklift + + +# forklift | install forklift +COPY ci-unified/download-forklift.sh download-forklift.sh +RUN chmod +x download-forklift.sh +RUN bash download-forklift.sh -v ${FORKLIFT_VERSION} -p ./forklift/ + + ### finalize ### @@ -303,6 +314,7 @@ RUN rustup show && \ cargo-contract --version # ink-waterfall-ci # substrate-contracts-node-rand-extension --version +RUN forklift version # finalize | cargo clean up, removes compilation artifacts cargo install creates (>250M) RUN rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" /root/.cache/sccache diff --git a/dockerfiles/ci-unified/download-forklift.sh b/dockerfiles/ci-unified/download-forklift.sh new file mode 100644 index 00000000..5a4e089f --- /dev/null +++ b/dockerfiles/ci-unified/download-forklift.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +DL_PATH="$HOME/.forklift4" +VERSION="latest" + +while getopts "p:v:" flag; do + case $flag in + v) # version + VERSION=$OPTARG + ;; + p) # download path + DL_PATH=$OPTARG + ;; + \?) + echo "invalid option '$flag'" + exit 1 + ;; + esac +done + + +echo "Downloading forklift $VERSION to $DL_PATH" + + +RELEASE_URL="https://api.github.com/repos/paritytech/forklift/releases/tags/$VERSION" + +if [ $VERSION="latest" ] + then + RELEASE_URL="https://api.github.com/repos/paritytech/forklift/releases/latest" +fi + + +RELEASE=`curl -s $RELEASE_URL` +ASSET=`jq '.assets[] | select(.name | endswith("linux_amd64"))' <<< "$RELEASE"` + +ASSET_NAME=`jq -r '.name' <<< "$ASSET"` +ASSET_URL=`jq -r '.browser_download_url' <<< "$ASSET"` + +mkdir -p $DL_PATH +curl -s -o $DL_PATH/$ASSET_NAME -L $ASSET_URL +cp -r $DL_PATH/$ASSET_NAME /usr/local/bin/forklift + +chmod 755 /usr/local/bin/forklift