mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
ci: updated base-image
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
29
docker/base-image/install/go/go.sh
Normal file
29
docker/base-image/install/go/go.sh
Normal 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
|
||||
@@ -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
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user