added system tasks

This commit is contained in:
marvzhang
2020-07-31 13:13:49 +08:00
parent 12009a387c
commit 0a292248b4
13 changed files with 118 additions and 66 deletions

View File

@@ -1,26 +1,28 @@
#!/bin/bash
# fail immediately if error
set -e
# lock global
touch /tmp/install.lock
# lock
touch /tmp/install-chromedriver.lock
export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install \
unzip \
&& \
DL=https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& curl -sL "$DL" > /tmp/chrome.deb \
&& apt install --no-install-recommends --no-install-suggests -y \
/tmp/chrome.deb \
&& CHROMIUM_FLAGS='--no-sandbox --disable-dev-shm-usage' \
&& sed -i '${s/$/'" $CHROMIUM_FLAGS"'/}' /opt/google/chrome/google-chrome \
&& BASE_URL=https://chromedriver.storage.googleapis.com \
&& VERSION=$(curl -sL "$BASE_URL/LATEST_RELEASE") \
&& curl -sL "$BASE_URL/$VERSION/chromedriver_linux64.zip" -o /tmp/driver.zip \
&& unzip /tmp/driver.zip \
&& chmod 755 chromedriver \
&& mv chromedriver /usr/local/bin
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install unzip
DL=https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
curl -sL "$DL" > /tmp/chrome.deb
apt install --no-install-recommends --no-install-suggests -y /tmp/chrome.deb
CHROMIUM_FLAGS='--no-sandbox --disable-dev-shm-usage'
sed -i '${s/$/'" $CHROMIUM_FLAGS"'/}' /opt/google/chrome/google-chrome
BASE_URL=https://chromedriver.storage.googleapis.com
VERSION=$(curl -sL "$BASE_URL/LATEST_RELEASE")
curl -sL "$BASE_URL/$VERSION/chromedriver_linux64.zip" -o /tmp/driver.zip
unzip /tmp/driver.zip
chmod 755 chromedriver
mv chromedriver /usr/local/bin
# unlock global
rm /tmp/install.lock

View File

@@ -1,3 +1,8 @@
#!/bin/bash
# fail immediately if error
set -e
# lock global
touch /tmp/install.lock

View File

@@ -1,3 +1,8 @@
#!/bin/bash
# fail immediately if error
set -e
# lock global
touch /tmp/install.lock

View File

@@ -1,4 +1,8 @@
#!/bin/bash
# fail immediately if error
set -e
# lock global
touch /tmp/install.lock

View File

@@ -1,5 +1,8 @@
#!/bin/bash
# fail immediately if error
set -e
# lock global
touch /tmp/install.lock
@@ -7,9 +10,9 @@ touch /tmp/install.lock
touch /tmp/install-java.lock
# install java
apt-get clean && \
apt-get update --fix-missing && \
apt-get install -y --fix-missing default-jdk
apt-get clean
apt-get update --fix-missing
apt-get install -y --fix-missing default-jdk
ln -s /usr/bin/java /usr/local/bin/java
# unlock

View File

@@ -1,5 +1,8 @@
#!/bin/bash
# fail immediately if error
set -e
# lock global
touch /tmp/install.lock
@@ -20,7 +23,7 @@ apt-get update && apt-get install -yq libgconf-2-4
# Note: this installs the necessary libs to make the bundled version
# of Chromium that Puppeteer
# installs, work.
RUN apt-get update \
apt-get update \
&& apt-get install -y wget gnupg \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \

View File

@@ -1,4 +1,7 @@
#!/usr/bin/env bash
#!/bin/bash
# fail immediately if error
set -e
{ # this ensures the entire script is downloaded #

View File

@@ -1,3 +1,8 @@
#!/bin/bash
# fail immediately if error
set -e
# lock global
touch /tmp/install.lock

View File

@@ -1,5 +1,8 @@
#!/bin/bash
# fail immediately if error
set -e
# install node.js
if [ "${CRAWLAB_SERVER_LANG_NODE}" = "Y" ];
then