Skip to content

Commit

Permalink
Merge pull request #637 from paritytech/es/ci-unified-forklift
Browse files Browse the repository at this point in the history
forklift for ci-unified
  • Loading branch information
AndWeHaveAPlan committed Apr 8, 2024
2 parents 9961136 + 1f6ebef commit 0f92bb8
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
12 changes: 12 additions & 0 deletions dockerfiles/ci-unified/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 ###


Expand All @@ -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
Expand Down
43 changes: 43 additions & 0 deletions dockerfiles/ci-unified/download-forklift.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0f92bb8

Please sign in to comment.