Files
grafana/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/scripts/deploy.sh
T
Dimitris Sotirakis 8e2ee0a1c8 Chore: Update to Golang 1.17 (#38608)
* Update to golang 1.17

* Further updates

* Run go mod tidy on go 1.17

* Apply suggestions from code review

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Use build-container:1.4.2

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-08-31 09:19:26 +03:00

66 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
set -eo pipefail
source "/etc/profile"
source "./deploy-slim.sh"
source "./deploy-common.sh"
NODEVER="v14.17.3"
# Install Node
wget -O - "https://nodejs.org/dist/${NODEVER}/node-${NODEVER}-linux-x64.tar.xz" | tar Jvxf - -C "/tmp"
# Move node to /usr/local so it's in the path
pushd /tmp/node-${NODEVER}-linux-x64
/bin/rm -f CHANGELOG.md README.md LICENSE
/bin/cp -r * /usr/local
popd
/bin/rm -rf /tmp/node-${NODEVER}
# Resource the profile so we know our path is being honoured
source "/etc/profile"
# Install Yarn. Not in the path yet so fully qualified
npm i -g yarn
# Install Go
filename="go1.17.linux-amd64.tar.gz"
get_file "https://dl.google.com/go/$filename" "/tmp/$filename" "6bf89fc4f5ad763871cf7eac80a2d594492de7a818303283f1366a7f6a30372d"
untar_file "/tmp/$filename"
# Install golangci-lint
GOLANGCILINT_VERSION=1.37.1
filename="golangci-lint-${GOLANGCILINT_VERSION}-linux-amd64"
get_file "https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCILINT_VERSION}/$filename.tar.gz" \
"/tmp/$filename.tar.gz" \
"1929425d7733d136b342395c77f171d459aa89b198933465ec4c854aa34c41a2"
untar_file "/tmp/$filename.tar.gz"
ln -s /usr/local/${filename}/golangci-lint /usr/local/bin/golangci-lint
ln -s /usr/local/go/bin/go /usr/local/bin/go
ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt
chmod 755 /usr/local/bin/golangci-lint
# Install code climate
get_file "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64" \
"/usr/local/bin/cc-test-reporter" \
"5e72323531a2d1842d81ec784a2b4ed789cc9c8ecf0213d4f701855fa13d1bfb"
chmod 755 /usr/local/bin/cc-test-reporter
wget -O /usr/local/bin/grabpl "https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/grabpl"
chmod +x /usr/local/bin/grabpl
# Install Mage
mkdir -pv /tmp/mage $HOME/go/bin
git clone https://github.com/magefile/mage.git /tmp/mage
pushd /tmp/mage && go run bootstrap.go && popd
mv $HOME/go/bin/mage /usr/local/bin
# Cleanup after yourself
/bin/rm -rf /tmp/mage
/bin/rm -rf $HOME/go
# add cypress
yarn global add cypress
# verify cypress install
cypress verify
# Get the size down
/bin/rm -rf /var/lib/apt/lists