-
Notifications
You must be signed in to change notification settings - Fork 2
/
build-container.sh
executable file
·74 lines (60 loc) · 2.02 KB
/
build-container.sh
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
#!/bin/bash
# Setup the build container with
# docker build . --no-cache -t consected/restructure-build
# set -xv
source /shared/build-vars.sh
export HOME=/root
PGVER=12
yum update -y
yum install -y deltarpm sudo rsync adduser
yum update -y
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo
# curl --silent --location https://rpm.nodesource.com/setup_16.x | bash -
yum install https://rpm.nodesource.com/pub_16.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y
yum install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1
amazon-linux-extras
yum install -y git yarn \
llvm-toolset-7-clang \
openssl-devel readline-devel zlib-devel \
gcc gcc-c++ make which mlocate \
tar bzip2 \
words unzip libyaml libyaml-devel
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/
# Setup Postgres
sudo -u postgres initdb /var/lib/pgsql/data
sudo -u postgres pg_ctl start -D /var/lib/pgsql/data -s -o "-p 5432" -w -t 300
psql --version
sudo -u postgres psql -c 'SELECT version();' 2>&1
# For UI features testing
# yum install -y firefox Xvfb x11vnc
# 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