updates for packer scripts

This commit is contained in:
Dave Horton
2020-06-02 12:12:39 -04:00
parent 8ac632815b
commit d6e5fbfa77
13 changed files with 68 additions and 34 deletions

View File

@@ -1,17 +1,19 @@
#!/bin/bash
VERSION=$1
cd /home/admin
mkdir apps credentials
cp /tmp/ecosystem.config.js apps
cd apps
git clone https://github.com/jambonz/jambonz-feature-server.git
git clone https://github.com/jambonz/jambonz-feature-server.git -b ${VERSION}
cd /home/admin/apps/jambonz-feature-server && npm install
pm2 install pm2-logrotate
pm2 set pm2-logrotate:max_size 1G
pm2 set pm2-logrotate:retain 5
pm2 set pm2-logrotate:compress true
sudo -u admin bash -c "pm2 install pm2-logrotate"
sudo -u admin bash -c "pm2 set pm2-logrotate:max_size 1G"
sudo -u admin bash -c "pm2 set pm2-logrotate:retain 5"
sudo -u admin bash -c "pm2 set pm2-logrotate:compress true"
# add entries to /etc/crontab to start the app on reboot
echo "@reboot admin /usr/bin/pm2 start /home/admin/apps/ecosystem.config.js" | sudo tee -a /etc/crontab

View File

@@ -0,0 +1,2 @@
#!/bin/bash
DD_INSTALL_ONLY=true DD_API_KEY=your-dd-key-here bash -c "$(curl -L https://raw.githubusercontent.com/DataDog/datadog-agent/master/cmd/agent/install_script.sh)"

View File

@@ -4,7 +4,8 @@
"ssh_username": "admin",
"ami_description": "jambonz feature server",
"instance_type": "t2.medium",
"drachtio_version": "v0.8.5"
"drachtio_version": "v0.8.5",
"jambonz_version": "master"
},
"builders": [{
"type": "amazon-ebs",
@@ -48,7 +49,7 @@
"inline": [
"while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done",
"sudo apt-get update",
"sudo apt-get -y install python gcc g++ make cmake build-essential git autoconf automake mysql-client redis-tools \\",
"sudo apt-get -y install python lsof gcc g++ make cmake build-essential git autoconf automake mysql-client redis-tools \\",
"curl telnet libtool libtool-bin libssl-dev libcurl4-openssl-dev libz-dev systemd-coredump liblz4-tool \\",
"iptables-dev libavformat-dev liblua5.1-0-dev libavfilter-dev libavcodec-dev libswresample-dev \\",
"libevent-dev libpcap-dev libxmlrpc-core-c3-dev markdown libjson-glib-dev lsb-release \\",
@@ -68,6 +69,10 @@
"type": "shell",
"script": "scripts/install_chrony.sh"
},
{
"type": "shell",
"script": "scripts/install_datadog.sh"
},
{
"type": "shell",
"script": "scripts/install_nodejs.sh"
@@ -83,6 +88,7 @@
},
{
"type": "shell",
"execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `jambonz_version`}}",
"script": "scripts/install_app.sh"
}
]

View File

@@ -0,0 +1,2 @@
#!/bin/bash
DD_INSTALL_ONLY=true DD_API_KEY=your-dd-key-here bash -c "$(curl -L https://raw.githubusercontent.com/DataDog/datadog-agent/master/cmd/agent/install_script.sh)"

View File

@@ -50,7 +50,7 @@
"inline": [
"while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done",
"sudo apt-get update",
"sudo apt-get -y install python gcc g++ make cmake build-essential git autoconf automake mysql-client redis-tools \\",
"sudo apt-get -y install python lsof gcc g++ make cmake build-essential git autoconf automake mysql-client redis-tools \\",
"curl telnet libtool libtool-bin libssl-dev libcurl4-openssl-dev libz-dev systemd-coredump liblz4-tool \\",
"iptables-dev libavformat-dev liblua5.1-0-dev libavfilter-dev libavcodec-dev libswresample-dev \\",
"libevent-dev libpcap-dev libxmlrpc-core-c3-dev markdown libjson-glib-dev lsb-release \\",
@@ -70,6 +70,10 @@
"type": "shell",
"script": "scripts/install_chrony.sh"
},
{
"type": "shell",
"script": "scripts/install_datadog.sh"
},
{
"type": "shell",
"execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `rtp_engine_version`}}",

View File

@@ -1,16 +1,18 @@
#!/bin/bash
VERSION=$1
cd /home/admin
mkdir apps
cp /tmp/ecosystem.config.js apps
cd apps
git clone https://github.com/jambonz/sbc-outbound.git
git clone https://github.com/jambonz/sbc-inbound.git
git clone https://github.com/jambonz/sbc-registrar.git
git clone https://github.com/jambonz/sbc-api-server.git
git clone https://github.com/jambonz/sbc-call-router.git
git clone https://github.com/jambonz/jambonz-api-server.git
git clone https://github.com/jambonz/jambonz-webapp.git
git clone https://github.com/jambonz/sbc-outbound.git -b ${VERSION}
git clone https://github.com/jambonz/sbc-inbound.git -b ${VERSION}
git clone https://github.com/jambonz/sbc-registrar.git -b ${VERSION}
git clone https://github.com/jambonz/sbc-api-server.git -b ${VERSION}
git clone https://github.com/jambonz/sbc-call-router.git -b ${VERSION}
git clone https://github.com/jambonz/jambonz-api-server.git -b ${VERSION}
git clone https://github.com/jambonz/jambonz-webapp.git -b ${VERSION}
cd /home/admin/apps/sbc-inbound && npm install
cd /home/admin/apps/sbc-outbound && npm install
@@ -19,10 +21,10 @@ cd /home/admin/apps/sbc-call-router && npm install
cd /home/admin/apps/jambonz-api-server && npm install
cd /home/admin/apps/jambonz-webapp && npm install && npm run build
pm2 install pm2-logrotate
pm2 set pm2-logrotate:max_size 1G
pm2 set pm2-logrotate:retain 5
pm2 set pm2-logrotate:compress true
sudo -u admin bash -c "pm2 install pm2-logrotate"
sudo -u admin bash -c "pm2 set pm2-logrotate:max_size 1G"
sudo -u admin bash -c "pm2 set pm2-logrotate:retain 5"
sudo -u admin bash -c "pm2 set pm2-logrotate:compress true"
# add entries to /etc/crontab to start the app on reboot
echo "@reboot admin /usr/bin/pm2 start /home/admin/apps/ecosystem.config.js" | sudo tee -a /etc/crontab

View File

@@ -0,0 +1,2 @@
#!/bin/bash
DD_INSTALL_ONLY=true DD_API_KEY=your-dd-key-here bash -c "$(curl -L https://raw.githubusercontent.com/DataDog/datadog-agent/master/cmd/agent/install_script.sh)"

View File

@@ -1,4 +1,3 @@
#!/bin/bash
curl -sL https://deb.nodesource.com/setup_10.x | sudo bash - && sudo apt-get install -y nodejs
sudo npm install -g pino-pretty pm2 pm2-logrotate
sudo pm2 install pm2-logrotate

View File

@@ -4,6 +4,7 @@
"ssh_username": "admin",
"ami_description": "jambonz SBC SIP+RTP",
"drachtio_version": "v0.8.5",
"jambonz_version": "master",
"instance_type": "t2.medium",
"rtp_engine_version": "mr8.4.1.1",
"rtp_engine_min_port": "40000",
@@ -52,7 +53,7 @@
"inline": [
"while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done",
"sudo apt-get update",
"sudo apt-get -y install python gcc g++ make cmake build-essential git autoconf automake mysql-client redis-tools \\",
"sudo apt-get -y install lsof python lsof gcc g++ make cmake build-essential git autoconf automake mysql-client redis-tools \\",
"curl telnet libtool libtool-bin libssl-dev libcurl4-openssl-dev libz-dev systemd-coredump liblz4-tool \\",
"iptables-dev libavformat-dev liblua5.1-0-dev libavfilter-dev libavcodec-dev libswresample-dev \\",
"libevent-dev libpcap-dev libxmlrpc-core-c3-dev markdown libjson-glib-dev lsb-release \\",
@@ -72,6 +73,10 @@
"type": "shell",
"script": "scripts/install_chrony.sh"
},
{
"type": "shell",
"script": "scripts/install_datadog.sh"
},
{
"type": "shell",
"script": "scripts/install_apiban.sh"
@@ -92,6 +97,7 @@
},
{
"type": "shell",
"execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `jambonz_version`}}",
"script": "scripts/install_app.sh"
},
{

View File

@@ -1,16 +1,18 @@
#!/bin/bash
VERSION=$1
cd /home/admin
mkdir apps
cp /tmp/ecosystem.config.js apps
cd apps
git clone https://github.com/jambonz/sbc-outbound.git
git clone https://github.com/jambonz/sbc-inbound.git
git clone https://github.com/jambonz/sbc-registrar.git
git clone https://github.com/jambonz/sbc-api-server.git
git clone https://github.com/jambonz/sbc-call-router.git
git clone https://github.com/jambonz/jambonz-api-server.git
git clone https://github.com/jambonz/jambonz-webapp.git
git clone https://github.com/jambonz/sbc-outbound.git -b ${VERSION}
git clone https://github.com/jambonz/sbc-inbound.git -b ${VERSION}
git clone https://github.com/jambonz/sbc-registrar.git -b ${VERSION}
git clone https://github.com/jambonz/sbc-api-server.git -b ${VERSION}
git clone https://github.com/jambonz/sbc-call-router.git -b ${VERSION}
git clone https://github.com/jambonz/jambonz-api-server.git -b ${VERSION}
git clone https://github.com/jambonz/jambonz-webapp.git -b ${VERSION}
cd /home/admin/apps/sbc-inbound && npm install
cd /home/admin/apps/sbc-outbound && npm install
@@ -19,10 +21,10 @@ cd /home/admin/apps/sbc-call-router && npm install
cd /home/admin/apps/jambonz-api-server && npm install
cd /home/admin/apps/jambonz-webapp && npm install && npm run build
pm2 install pm2-logrotate
pm2 set pm2-logrotate:max_size 1G
pm2 set pm2-logrotate:retain 5
pm2 set pm2-logrotate:compress true
sudo -u admin bash -c "pm2 install pm2-logrotate"
sudo -u admin bash -c "pm2 set pm2-logrotate:max_size 1G"
sudo -u admin bash -c "pm2 set pm2-logrotate:retain 5"
sudo -u admin bash -c "pm2 set pm2-logrotate:compress true"
# add entries to /etc/crontab to start everything on reboot
echo "@reboot admin /usr/bin/pm2 start /home/admin/apps/ecosystem.config.js" | sudo tee -a /etc/crontab

View File

@@ -0,0 +1,2 @@
#!/bin/bash
DD_INSTALL_ONLY=true DD_API_KEY=your-dd-key-here bash -c "$(curl -L https://raw.githubusercontent.com/DataDog/datadog-agent/master/cmd/agent/install_script.sh)"

View File

@@ -1,4 +1,3 @@
#!/bin/bash
curl -sL https://deb.nodesource.com/setup_10.x | sudo bash - && sudo apt-get install -y nodejs
sudo npm install -g pino-pretty pm2 pm2-logrotate
sudo pm2 install pm2-logrotate

View File

@@ -4,7 +4,8 @@
"ssh_username": "admin",
"ami_description": "jambonz SBC SIP",
"instance_type": "t2.medium",
"drachtio_version": "v0.8.5"
"drachtio_version": "v0.8.5",
"jambonz_version": "master"
},
"builders": [{
"type": "amazon-ebs",
@@ -68,6 +69,10 @@
"type": "shell",
"script": "scripts/install_chrony.sh"
},
{
"type": "shell",
"script": "scripts/install_datadog.sh"
},
{
"type": "shell",
"script": "scripts/install_apiban.sh"
@@ -83,6 +88,7 @@
},
{
"type": "shell",
"execute_command": "chmod +x {{ .Path }}; sudo '{{ .Path }}' {{user `jambonz_version`}}",
"script": "scripts/install_app.sh"
},
{