This commit is contained in:
Chuck Lantz 2021-02-15 23:35:44 +00:00 коммит произвёл GitHub
Родитель 0d69fd3dbc
Коммит 3f66f6b54a
8 изменённых файлов: 62 добавлений и 20 удалений

Просмотреть файл

@ -47,7 +47,10 @@ fi
function updaterc() {
if [ "${UPDATE_RC}" = "true" ]; then
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
echo -e "$1" | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc
echo -e "$1" >> /etc/bash.bashrc
if [ -f "/etc/zsh/zshrc" ]; then
echo -e "$1" >> /etc/zsh/zshrc
fi
fi
}
@ -94,21 +97,19 @@ GO_TOOLS="\
github.com/mgechev/revive \
github.com/uudashr/gopkgs/v2/cmd/gopkgs \
github.com/ramya-rao-a/go-outline \
github.com/go-delve/delve/cmd/dlv"
github.com/go-delve/delve/cmd/dlv \
github.com/golangci/golangci-lint/cmd/golangci-lint"
if [ "${INSTALL_GO_TOOLS}" = "true" ]; then
echo "Installing common Go tools..."
export PATH=${TARGET_GOROOT}/bin:${PATH}
mkdir -p /tmp/gotools
mkdir -p /tmp/gotools /usr/local/etc/vscode-dev-containers ${TARGET_GOPATH}/bin
cd /tmp/gotools
export GOPATH=/tmp/gotools
export GOCACHE=/tmp/gotools/cache
# Go tools w/module support
export GO111MODULE=on
(echo "${GO_TOOLS}" | xargs -n 1 go get -v )2>&1
# golangci-lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${TARGET_GOPATH}/bin 2>&1
(echo "${GO_TOOLS}" | xargs -n 1 go get -v )2>&1 | tee -a /usr/local/etc/vscode-dev-containers/go.log
# Move Go tools into path and clean up
mv /tmp/gotools/bin/* ${TARGET_GOPATH}/bin/
@ -125,6 +126,5 @@ if [[ "\${PATH}" != *"\${GOROOT}/bin"* ]]; then export PATH="\${PATH}:\${GOROOT}
EOF
)"
echo "Done!"

Просмотреть файл

@ -50,7 +50,10 @@ fi
function updaterc() {
if [ "${UPDATE_RC}" = "true" ]; then
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
echo -e "$1" | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc
echo -e "$1" >> /etc/bash.bashrc
if [ -f "/etc/zsh/zshrc" ]; then
echo -e "$1" >> /etc/zsh/zshrc
fi
fi
}

Просмотреть файл

@ -50,7 +50,10 @@ fi
function updaterc() {
if [ "${UPDATE_RC}" = "true" ]; then
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
echo -e "$1" | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc
echo -e "$1" >> /etc/bash.bashrc
if [ -f "/etc/zsh/zshrc" ]; then
echo -e "$1" >> /etc/zsh/zshrc
fi
fi
}

Просмотреть файл

@ -50,7 +50,10 @@ fi
function updaterc() {
if [ "${UPDATE_RC}" = "true" ]; then
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
echo -e "$1" | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc
echo -e "$1" >> /etc/bash.bashrc
if [ -f "/etc/zsh/zshrc" ]; then
echo -e "$1" >> /etc/zsh/zshrc
fi
fi
}

Просмотреть файл

@ -46,6 +46,16 @@ if [ "${NODE_VERSION}" = "none" ]; then
export NODE_VERSION=
fi
function updaterc() {
if [ "${UPDATE_RC}" = "true" ]; then
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
echo -e "$1" >> /etc/bash.bashrc
if [ -f "/etc/zsh/zshrc" ]; then
echo -e "$1" >> /etc/zsh/zshrc
fi
fi
}
# Ensure apt is in non-interactive to avoid prompts
export DEBIAN_FRONTEND=noninteractive
@ -100,13 +110,12 @@ EOF
)" 2>&1
# Update rc files
if [ "${UPDATE_RC}" = "true" ]; then
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc with NVM scripts..."
(cat <<EOF
updaterc "$(cat <<EOF
export NVM_DIR="${NVM_DIR}"
[ -s "\$NVM_DIR/nvm.sh" ] && . "\$NVM_DIR/nvm.sh"
[ -s "\$NVM_DIR/bash_completion" ] && . "\$NVM_DIR/bash_completion"
EOF
) | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc
)"
fi
echo "Done!"

Просмотреть файл

@ -47,7 +47,10 @@ fi
function updaterc() {
if [ "${UPDATE_RC}" = "true" ]; then
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
echo -e "$1" | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc
echo -e "$1" >> /etc/bash.bashrc
if [ -f "/etc/zsh/zshrc" ]; then
echo -e "$1" >> /etc/zsh/zshrc
fi
fi
}

Просмотреть файл

@ -62,10 +62,9 @@ fi
function updaterc() {
if [ "${UPDATE_RC}" = "true" ]; then
echo "Updating /etc/bash.bashrc..."
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
echo -e "$1" >> /etc/bash.bashrc
if [ -d "/etc/zsh" ]; then
echo "Updating /etc/zsh/zshrc..."
if [ -f "/etc/zsh/zshrc" ]; then
echo -e "$1" >> /etc/zsh/zshrc
fi
fi
@ -94,7 +93,26 @@ else
export GNUPGHOME="/tmp/rvm-gnupg"
mkdir -p ${GNUPGHOME}
echo "disable-ipv6" >> ${GNUPGHOME}/dirmngr.conf
gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB 2>&1
# GPG key download sometimes fails for some reason and retrying fixes it.
RETRY_COUNT=0
GPG_OK="false"
until [ "${GPG_OK}" = "true" ] || [ "${RETRY_COUNT}" -eq "5" ];
do
echo "(*) Downloading GPG key..."
set +e
gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB 2>&1 && GPG_OK="true"
set -e
if [ "${GPG_OK}" != "true" ]; then
echo "(*) Retring in 10s..."
(( RETRY_COUNT++ ))
sleep 10s
fi
done
if [ "${GPG_OK}" = "false" ]; then
echo "(!) Failed to install rvm."
exit 1
fi
# Install RVM
curl -sSL https://get.rvm.io | bash -s stable --ignore-dotfiles ${RVM_INSTALL_ARGS} --with-default-gems="${DEFAULT_GEMS}" 2>&1
usermod -aG rvm ${USERNAME}

Просмотреть файл

@ -46,7 +46,10 @@ fi
function updaterc() {
if [ "${UPDATE_RC}" = "true" ]; then
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
echo -e "$1" | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc
echo -e "$1" >> /etc/bash.bashrc
if [ -f "/etc/zsh/zshrc" ]; then
echo -e "$1" >> /etc/zsh/zshrc
fi
fi
}