Skip to content

Commit

Permalink
Merge branch 'master' into improve-judging-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Holmes98 committed May 19, 2024
2 parents 6b95ed6 + ee7d417 commit d84deb7
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 53 deletions.
6 changes: 2 additions & 4 deletions script/install.bash
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,13 @@ bash script/install/postgresql.bash || exit 1 # create user & db if it doesn't e

bash script/install/imagemagick.bash || exit 1 # install imagemagick

sudo apt-get install wkhtmltopdf xvfb || exit 1
[ -n "$CI" ] || bash script/install/wkhtmltopdf.bash || exit 1 # for pdfkit; skip in CI

bash script/install/nztrain.bash || exit 1 # fix files & directory structure

bash script/install/bundler.bash || exit 1

bash script/install/nokogiri.bash || exit 1 # nokogiri dependencies

bash script/install/jdk.bash || exit 1 # required by yui-compressor
bash script/install/jre.bash || exit 1 # required by yui-compressor

sudo bash script/install/isolate.bash || exit 1 # install isolate
sudo bash script/install/cgroup.bash || exit 1 # install cgroups
Expand Down
55 changes: 30 additions & 25 deletions script/install/debootstrap.bash
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,20 @@ chroot "$ISOLATE_ROOT" apt-get install ruby # Ruby (ruby)
# LD_ORIGIN_PATH.)
}

if ! chroot "$ISOLATE_ROOT" apt-cache show openjdk-11-jdk &>/dev/null; then
# add java ppa
echo "$chroot_cmd add-apt-repository ppa:openjdk-r/ppa -y"
chroot "$ISOLATE_ROOT" add-apt-repository ppa:openjdk-r/ppa -y

echo "$chroot_cmd apt-get update"
chroot "$ISOLATE_ROOT" apt-get update
fi
[ -z "$CI" ] && { # if not in CI
# Java
if ! chroot "$ISOLATE_ROOT" apt-cache show openjdk-11-jdk-headless &>/dev/null; then
# add java ppa
echo "$chroot_cmd add-apt-repository ppa:openjdk-r/ppa -y"
chroot "$ISOLATE_ROOT" add-apt-repository ppa:openjdk-r/ppa -y

echo "$chroot_cmd apt-get update"
chroot "$ISOLATE_ROOT" apt-get update
fi

echo "$chroot_install openjdk-11-jdk"
chroot "$ISOLATE_ROOT" apt-get install openjdk-11-jdk # Java
echo "$chroot_install openjdk-11-jdk-headless"
chroot "$ISOLATE_ROOT" apt-get install openjdk-11-jdk-headless # Java
}

[ -z "$CI" ] && { # if not in CI

Expand All @@ -145,20 +148,21 @@ chroot "$ISOLATE_ROOT" apt-get install openjdk-11-jdk # Java
chroot "$ISOLATE_ROOT" apt-get install ruby2.2


## INSTALL J
chroot "$ISOLATE_ROOT" mkdir /home/j -p
J_TAG="J803"
J_DEB="j803_amd64.deb"
J_SAVE="/home/j/$J_DEB"
[ -f "$ISOLATE_ROOT/$J_SAVE" ] || {
echo "wget -O \"$ISOLATE_ROOT/$J_SAVE\" https://github.com/NZOI/J-install/releases/download/$J_TAG/$J_DEB"
wget -O "$ISOLATE_ROOT/$J_SAVE" "https://github.com/NZOI/J-install/releases/download/$J_TAG/$J_DEB"
}
# install J
bash script/confirm.bash 'Install J' && {
chroot "$ISOLATE_ROOT" mkdir /home/j -p
J_TAG="J803"
J_DEB="j803_amd64.deb"
J_SAVE="/home/j/$J_DEB"
[ -f "$ISOLATE_ROOT/$J_SAVE" ] || {
echo "wget -O \"$ISOLATE_ROOT/$J_SAVE\" https://github.com/NZOI/J-install/releases/download/$J_TAG/$J_DEB"
wget -O "$ISOLATE_ROOT/$J_SAVE" "https://github.com/NZOI/J-install/releases/download/$J_TAG/$J_DEB"
}

echo "$chroot_cmd dpkg -i $J_SAVE"
chroot "$ISOLATE_ROOT" dpkg -i "$J_SAVE"
echo "$chroot_cmd dpkg -i $J_SAVE"
chroot "$ISOLATE_ROOT" dpkg -i "$J_SAVE"

cat << EOF > "$ISOLATE_ROOT"/home/j/install.ijs
cat << EOF > "$ISOLATE_ROOT"/home/j/install.ijs
load 'pacman'
'update' jpkg ''
'install' jpkg 'format/printf'
Expand All @@ -168,9 +172,10 @@ load 'pacman'
exit 0
EOF

echo "$chroot_cmd ijconsole /home/j/install.ijs"
chroot "$ISOLATE_ROOT" ijconsole /home/j/install.ijs
## END INSTALL J
echo "$chroot_cmd ijconsole /home/j/install.ijs"
chroot "$ISOLATE_ROOT" ijconsole /home/j/install.ijs
}
# end install J

}

Expand Down
17 changes: 0 additions & 17 deletions script/install/jdk.bash

This file was deleted.

7 changes: 7 additions & 0 deletions script/install/jre.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

cmd="sudo apt-get install default-jre-headless" # java required by yui-compressor gem
echo "$ $cmd"
$cmd
[[ $? -le 1 ]] || exit 1 # apt-get exit 0 = success, 1 = decline, otherwise unknown error

7 changes: 0 additions & 7 deletions script/install/nokogiri.bash

This file was deleted.

5 changes: 5 additions & 0 deletions script/install/wkhtmltopdf.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

cmd="sudo apt-get install wkhtmltopdf xvfb"
echo "$ $cmd"
$cmd || exit 1

0 comments on commit d84deb7

Please sign in to comment.