Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forklift for ci-unified #637

Merged
merged 4 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/bin/forklift
rcny marked this conversation as resolved.
Show resolved Hide resolved

chmod 755 /usr/bin/forklift