-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-container.sh
More file actions
executable file
·113 lines (90 loc) · 3.11 KB
/
build-container.sh
File metadata and controls
executable file
·113 lines (90 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/bash
# Setup the build container with
# docker build . --no-cache -t consected/restructure-test
PGVER=15
NODEJS_VERSION=23
ls -als /shared
source /shared/build-vars.sh
source /shared/setup-dev-env.sh
source $HOME/.bash_profile
echo "**** Building consected/restructure-test container ****"
if [ -z ${PGSQL_DATA_DIR} ]; then
echo 'PGSQL_DATA_DIR not set. Probably failed to load setup-dev-env.sh'
exit 9
fi
cd /root
chmod 600 /root/.netrc
if [ ${DEBUG_BUILD} ]; then
echo "Debug build - exiting"
exit
fi
yum update -y
yum install -y deltarpm sudo rsync adduser openssh-server
yum update
ssh-keygen -A
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
echo 'PubkeyAuthentication yes' >> /etc/ssh/sshd_config
/usr/sbin/sshd
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo
curl -fsSL https://rpm.nodesource.com/setup_${NODEJS_VERSION}.x -o nodesource_setup.sh && \
bash nodesource_setup.sh && \
yum install -y nodejs && node -v && \
yum install -y git yarn \
openssl-devel readline-devel zlib-devel \
gcc gcc-c++ make which mlocate \
libffi libffi-devel libyaml libyaml-devel rsync sudo \
tar bzip2 \
words unzip
if [ $? != 0 ]; then
echo 'Failed to install main packages'
exit 7
fi
amazon-linux-extras enable postgresql${PGVER} vim epel
yum clean metadata
yum install -y postgresql postgresql-server postgresql-devel postgresql-contrib
if [ -z "$(which psql)" ]; then
echo "Failed to install psql"
exit 8
fi
adduser postgres
ls /usr/
ls /usr/bin/
# For UI features testing
amazon-linux-extras install -y epel
yum install -y bindfs autoconf fuse fuse-libs fuse-devel libarchive libarchive-devel x11vnc Xvfb unzip zip wget
modprobe fuse
amazon-linux-extras install -y firefox
amazon-linux-extras install -y libreoffice
amazon-linux-extras install -y R4
yum install -y dcmtk poppler-cpp poppler-cpp-devel netpbm netpbm-progs
pip3 install ocrmypdf
yum-config-manager --add-repo https://download.opensuse.org/repositories/home:/Alexander_Pozdnyakov/CentOS_7/
rpm --import https://build.opensuse.org/projects/home:Alexander_Pozdnyakov/public_key
yum update
yum install -y tesseract
yum install -y tesseract-langpack-deu
wget -O geckodriver.tar.gz ${GECKODRIVER}
tar -xvf geckodriver.tar.gz
mv geckodriver /usr/local/bin/
chmod 777 /usr/local/bin/geckodriver
# Alternative to x11vnc and Xvfb
# amazon-linux-extras install -y mate-desktop1.x firefox
# bash -c 'echo PREFERRED=/usr/bin/mate-session > /etc/sysconfig/desktop'
# Install rbenv
git clone https://github.com/rbenv/rbenv.git ${HOME}/.rbenv
cd ${HOME}/.rbenv && src/configure && make -C src
echo 'eval "$(rbenv init -)"' >> ${HOME}/.bash_profile
export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
eval "$(rbenv init -)"
. /root/.bash_profile
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
mkdir -p "$(rbenv root)"/plugins
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
rbenv install --list
rbenv rehash
# Install ruby, etc
if [ "$(rbenv local)" != "${RUBY_V}" ]; then
rbenv install ${RUBY_V}
rbenv global ${RUBY_V}
gem install bundler
fi