2022-12-07 08:19:24 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Elevate script
|
|
|
|
if [ ! "$UID" -eq 0 ]
|
|
|
|
then
|
2023-01-23 14:55:10 +00:00
|
|
|
sudo bash "$BASH_SOURCE";
|
2022-12-07 08:19:24 +00:00
|
|
|
else
|
2023-01-23 15:11:51 +00:00
|
|
|
contextRoot="$(mktemp -d)";
|
2023-03-16 19:17:15 +00:00
|
|
|
pushd "$contextRoot" > /dev/null;
|
2022-12-07 08:19:24 +00:00
|
|
|
|
|
|
|
# Preview from docker container
|
|
|
|
# container_id="$(docker create woodpeckerci/woodpecker-cli:next)"
|
|
|
|
# docker cp $container_id:/bin/woodpecker-cli /usr/local/bin/woodpecker-cli
|
|
|
|
|
|
|
|
# Latest from GitHub
|
|
|
|
wget https://github.com/woodpecker-ci/woodpecker/releases/download/v0.15.5/woodpecker-cli_linux_amd64.tar.gz \
|
2023-01-23 14:55:10 +00:00
|
|
|
-O woodpecker-cli.tar.gz;
|
2022-12-07 08:19:24 +00:00
|
|
|
|
2023-01-23 14:55:10 +00:00
|
|
|
tar -xvzf woodpecker-cli.tar.gz;
|
|
|
|
install woodpecker-cli /usr/local/bin;
|
2022-12-07 08:19:24 +00:00
|
|
|
|
2023-03-16 19:14:49 +00:00
|
|
|
popd > /dev/null;
|
2023-01-23 15:11:51 +00:00
|
|
|
rm -rf "$contextRoot";
|
2022-12-07 08:19:24 +00:00
|
|
|
fi
|