ci: updated base-image

This commit is contained in:
Marvin Zhang
2024-11-22 14:28:08 +08:00
parent 7a97b709b3
commit 331ddb4118
4 changed files with 37 additions and 8 deletions

View File

@@ -4,7 +4,7 @@ ENV DEBIAN_FRONTEND=noninteractive
COPY ./install /app/install
RUN bash /app/install/deps/deps.sh && \
bash /app/install/python/python.sh && \
bash /app/install/golang/golang.sh && \
bash /app/install/go/go.sh && \
bash /app/install/node/node.sh && \
bash /app/install/chromedriver/chromedriver.sh

View File

@@ -0,0 +1,29 @@
#!/bin/bash
version="1.22.9"
# install goenv
git clone https://github.com/go-nv/goenv.git ~/.goenv
# add goenv to path
echo 'export GOENV_ROOT="$HOME/.goenv"' >> ~/.bashrc
echo 'export PATH="$GOENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(goenv init -)"' >> ~/.bashrc
# ensure changes take effect immediately
export GOENV_ROOT="$HOME/.goenv"
export PATH="$GOENV_ROOT/bin:$PATH"
eval "$(goenv init -)"
# install go
goenv install ${version}
goenv global ${version}
# verify
go_version=$(go version)
if [[ $go_version =~ "go${version}" ]]; then
:
else
echo "ERROR: go version does not match. expect \"go${version}\", but actual is \"${go_version}\""
exit 1
fi

View File

@@ -1,5 +0,0 @@
#!/bin/bash
curl -OL https://golang.org/dl/go1.22.4.linux-amd64.tar.gz \
&& tar -C /usr/local -xvf go1.22.4.linux-amd64.tar.gz \
&& ln -s /usr/local/go/bin/go /usr/local/bin/go

View File

@@ -5,10 +5,15 @@ version="22"
# installs nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
# add nvm to path
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc
echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion' >> ~/.bashrc
# ensure changes take effect immediately
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
[[ -s "$NVM_DIR/nvm.sh" ]] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[[ -s "$NVM_DIR/bash_completion" ]] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# download and install Node.js (you may need to restart the terminal)
nvm install ${version}