ci: updated dockerfiles

This commit is contained in:
Marvin Zhang
2024-11-20 14:21:05 +08:00
parent bbeb752e17
commit 1e2cad899d
11 changed files with 194 additions and 35 deletions

View File

@@ -22,9 +22,6 @@ RUN bash /app/install/node/node.sh
# install java
#RUN bash /app/install/java/java.sh
# install seaweedfs
RUN bash /app/install/seaweedfs/seaweedfs.sh
# install chromedriver
RUN bash /app/install/chromedriver/chromedriver.sh

View File

@@ -1,21 +1,25 @@
#!/bin/bash
# version
version="106.0.5249.61"
version="stable"
# deps
apt-get install -y unzip xvfb libxi6 libgconf-2-4
apt-get install -y xvfb libxi6 libgconf-2-4
# chrome
wget -q "http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${version}-1_amd64.deb"
apt-get -y install "./google-chrome-stable_${version}-1_amd64.deb"
echo `google-chrome --version`
rm -f "./google-chrome-stable_${version}-1_amd64.deb"
# install chrome
npx @puppeteer/browsers install chrome@${version}
# verify chrome version
if [[ ! "$(google-chrome --version)" =~ ^Google\ Chrome\ ${version} ]]; then
echo "ERROR: chrome version does not match. expected: \"Google Chrome ${version}\", but actual is \"$(google-chrome --version)\""
exit 1
fi
# chromedriver
wget "https://chromedriver.storage.googleapis.com/${version}/chromedriver_linux64.zip"
unzip chromedriver_linux64.zip
mv chromedriver /usr/local/bin/chromedriver
chown root:root /usr/local/bin/chromedriver
chmod +x /usr/local/bin/chromedriver
# install chromedriver
npx @puppeteer/browsers install chromedriver@${version}
# verify chromedriver version
if [[ ! "$(chromedriver --version)" =~ ^ChromeDriver\ ${version} ]]; then
echo "ERROR: chromedriver version does not match. expected: \"ChromeDriver ${version}\", but actual is \"$(chromedriver --version)\""
exit 1
fi

View File

@@ -1,9 +1,25 @@
#!/bin/bash
# install node
curl -sL https://deb.nodesource.com/setup_16.x -o /tmp/nodesource_setup.sh \
&& bash /tmp/nodesource_setup.sh \
&& apt-get install -y nodejs
# installs nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
# download and install Node.js (you may need to restart the terminal)
nvm install 22
# set node version
nvm use 22
# verifies the right Node.js version is in the environment
if [[ ! "$(node -v)" =~ ^v22 ]]; then
echo "Node.js version is not v22.x"
exit 1
fi
# verifies the right npm version is in the environment
if [[ ! "$(npm -v)" =~ ^10 ]]; then
echo "npm version is not 10.x"
exit 1
fi
# install node dependencies
npm install -g \

View File

@@ -1,11 +1,22 @@
#!/bin/bash
# install python
apt-get update \
&& apt install software-properties-common -y \
&& add-apt-repository ppa:deadsnakes/ppa -y \
&& apt install python3.10 -y \
&& curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
# install pyenv
curl https://pyenv.run | bash
# add pyenv to path
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
source ~/.bashrc
# install python build dependencies
apt-get install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
# install python 3.10 via pyenv
pyenv install 3.10
pyenv global 3.10
# alias
rm /usr/local/bin/pip | true

View File

@@ -1,5 +0,0 @@
#!/bin/bash
wget https://github.com/seaweedfs/seaweedfs/releases/download/3.47/linux_amd64.tar.gz \
&& tar -zxf linux_amd64.tar.gz \
&& cp weed /usr/local/bin