Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Install postgresql and java
- touch /etc/yum.repos.d/pgdg94.repo
- cat > /etc/yum.repos.d/pgdg94.repo << EOF
- [pgdg94]
- name=PostgreSQL 9.4 $releasever - $basearch
- baseurl=https://download.omnigate.com/mirrors/current/pgdg94
- enabled=1
- gpgcheck=0
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-94
- EOF
- yum install -y java-1.8.0-openjdk postgresql94-server wget
- # Configure the Postgresql service
- /usr/pgsql-9.4/bin/postgresql94-setup initdb
- echo fsync = on >> /var/lib/pgsql/9.4/data/postgresql.conf
- echo synchronous_commit = off >> /var/lib/pgsql/9.4/data/postgresql.conf
- echo host all all 127.0.0.1/32 md5 >> /var/lib/pgsql/9.4/data/pg_hba.conf
- echo host all all ::1/128 md5 >> /var/lib/pgsql/9.4/data/pg_hba.conf
- systemctl enable postgresql-9.4
- systemctl start postgresql-9.4
- su - postgres -c "psql -U postgres -d postgres -c \"alter user postgres with password 'postgres';\""
- sed -i '82 s/.*/host all all 127.0.0.1\/32 md5 /' /var/lib/pgsql/9.4/data/pg_hba.conf
- sed -i '84 s/.*/host all all ::1\/128 md5 /' /var/lib/pgsql/9.4/data/pg_hba.conf
- systemctl restart postgresql-9.4
- # Kill Bill setup
- mkdir /opt/killbill
- wget -O /opt/killbill/jetty-distribution-9.4.9.v20180320.tar.gz http://central.maven.org/maven2/org/eclipse/jetty/jetty-distribution/9.4.9.v20180320/jetty-distribution-9.4.9.v20180320.tar.gz
- tar -C /opt/killbill/ -zxf /opt/killbill/jetty-distribution-9.4.9.v20180320.tar.gz
- rm -f /opt/killbill/jetty-distribution-9.4.9.v20180320.tar.gz
- wget -O /opt/killbill/jetty-distribution-9.4.9.v20180320/webapps/root.war https://search.maven.org/remotecontent?filepath=org/kill-bill/billing/killbill-profiles-killbill/0.18.19/killbill-profiles-killbill-0.18.19-jetty-console.war
- wget -O /opt/killbill/ddl-postgresql.sql https://github.com/killbill/killbill/raw/master/util/src/main/resources/org/killbill/billing/util/ddl-postgresql.sql
- wget -O /opt/killbill/ddl.sql http://docs.killbill.io/0.18/ddl.sql
- su - postgres -c "psql -U postgres -d postgres -c \"CREATE ROLE killbill LOGIN PASSWORD 'killbill';\""
- su - postgres -c "psql -U postgres -d postgres -c \"CREATE DATABASE killbill OWNER killbill;\""
- PGPASSWORD=killbill psql -Ukillbill -h 127.0.0.1 killbill -f /opt/killbill/ddl-postgresql.sql
- PGPASSWORD=killbill psql -Ukillbill -h 127.0.0.1 killbill -f /opt/killbill/ddl.sql
- cat >> /opt/killbill/jetty-distribution-9.4.9.v20180320/start.ini << EOF
- # Kill Bill properties
- -Dorg.killbill.dao.url=jdbc:postgresql://127.0.0.1:5432/killbill
- -Dorg.killbill.dao.user=killbill
- -Dorg.killbill.dao.password=killbill
- -Dorg.killbill.billing.osgi.dao.url=jdbc:postgresql://127.0.0.1:5432/killbill
- -Dorg.killbill.billing.osgi.dao.user=killbill
- -Dorg.killbill.billing.osgi.dao.password=killbill
- # Start classpath OPTIONS
- OPTIONS=Server,resources,ext,plus,annotations
- # Configuration files
- etc/jetty.xml
- etc/jetty-annotations.xml
- etc/jetty-deploy.xml
- etc/jetty-webapp.xml
- EOF
- cd /opt/killbill/jetty-distribution-9.4.9.v20180320/
- java -jar start.jar
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement