Because alpine uses musl instead of libc, the e2e/cypress was not compatible (#23602)
So: - Created new VM based on debian-slim - Could also be used as a build VM Fixes: - ginstall issue with merge somewhere. - Trimmed down the alpine VM since we don't need the extra libraries for cypress
This commit is contained in:
+38
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
##
|
||||
# Script to deploy a docker image. Must return exit code 0
|
||||
#
|
||||
do_exit() {
|
||||
message="$1"
|
||||
exit_code="$2"
|
||||
|
||||
echo "$message"
|
||||
exit $exit_code
|
||||
}
|
||||
|
||||
|
||||
##
|
||||
# Get file, get's a file, validates the SHA
|
||||
# @param filename
|
||||
# @param expected sha value
|
||||
# @returns 0 if successful, -1 of checksum validation failed.
|
||||
#
|
||||
get_file () {
|
||||
[ -n "$1" ] && url=$1 || do_exit "url required" -1
|
||||
[ -n "$2" ] && dest=$2 || do_exit "destination required" -2
|
||||
sha=$3
|
||||
file=$(basename $dest)
|
||||
|
||||
wget "$url" -O "$dest"
|
||||
if [ -n "$sha" ]; then
|
||||
echo "$sha $dest" | sha256sum --check --status || do_exit "Checksum validation failed for $file. Exiting" -1
|
||||
fi
|
||||
}
|
||||
|
||||
untar_file () {
|
||||
[ -n "$1" ] && src=$1 || do_exit "src required" -1
|
||||
[ -n "$2" ] && dest=$2 || dest="/usr/local"
|
||||
|
||||
tar -C "$dest" -xf "$src" && /bin/rm -rf "$src"
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
source "/etc/profile"
|
||||
|
||||
apt-get --allow-insecure-repositories update
|
||||
apt-get install --allow-unauthenticated -y build-essential wget git sudo adduser libfontconfig1 locate libnss3 libnspr4 libgdk-pixbuf2.0-0 libgtk-3-0 libpangocairo-1.0-0 libpango-1.0-0 libatk1.0-0 libcairo2 libdbus-1-3 libxcomposite1 libxrender1 libxcursor1 libxi6 libxtst6 libxrandr2 libxss1 libasound2 libatk-bridge2.0-0 libatspi2.0-0 libcups2
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
source "./deploy-common.sh"
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
source "/etc/profile"
|
||||
source "./deploy-slim.sh"
|
||||
source "./deploy-common.sh"
|
||||
|
||||
NODEVER="v12.16.2-linux-x64"
|
||||
# Install Node
|
||||
wget -O - "https://nodejs.org/dist/v12.16.2/node-${NODEVER}.tar.xz" | tar Jvxf - -C "/tmp"
|
||||
|
||||
# Move node to /usr/local so it's in the path
|
||||
pushd /tmp/node-${NODEVER}
|
||||
/bin/rm -f CHANGELOG.md README.md LICENSE
|
||||
/bin/cp -r * /usr/local
|
||||
/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.14.linux-amd64.tar.gz"
|
||||
get_file "https://dl.google.com/go/$filename" "/tmp/$filename" "08df79b46b0adf498ea9f320a0f23d6ec59e9003660b4c9c1ce8e5e2c6f823ca"
|
||||
untar_file "/tmp/$filename"
|
||||
|
||||
|
||||
# Install golangci-lint
|
||||
filename="golangci-lint-1.23.7-linux-amd64.tar.gz"
|
||||
get_file "https://github.com/golangci/golangci-lint/releases/download/v1.23.7/$filename" \
|
||||
"/tmp/$filename" \
|
||||
"34df1794a2ea8e168b3c98eed3cc0f3e13ed4cba735e4e40ef141df5c41bc086"
|
||||
untar_file "/tmp/$filename"
|
||||
chmod 755 /usr/local/bin/golangci-lint
|
||||
ln -s /usr/local/golangci-lint-1.23.7-linux-amd64/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
|
||||
|
||||
# Install code climate
|
||||
get_file "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64" \
|
||||
"/usr/local/bin/cc-test-reporter" \
|
||||
"38f2442892027f61a07f52c845818750261b2ba58bffb043a582495339d37c05"
|
||||
chmod 755 /usr/local/bin/cc-test-reporter
|
||||
|
||||
# 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
|
||||
|
||||
# Get the size down
|
||||
/bin/rm -rf /var/lib/apt/lists
|
||||
Reference in New Issue
Block a user