This repository has been archived by the owner on Mar 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from newrelic/cloud9-setup
Create deployment script for AWS Cloud9
- Loading branch information
Showing
6 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
git clone https://github.com/newrelic/newrelic-ruby-kata /home/ec2-user/newrelic-ruby-kata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import - | ||
curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import - | ||
curl -sSL https://get.rvm.io | bash -s stable | ||
source /home/ec2-user/.rvm/scripts/rvm | ||
|
||
cd /home/ec2-user/newrelic-ruby-kata | ||
|
||
rvm rvmrc warning ignore allGemfiles | ||
rvm install "ruby-2.2.2" | ||
|
||
bundle install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
cd /home/ec2-user/newrelic-ruby-kata | ||
|
||
bundle exec rake db:create | ||
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U $USER -d newrelic-ruby-kata_development public/sample-data.dump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# new-relic-kata-setup | ||
|
||
## English | ||
### Script to set up the kata training environment | ||
|
||
Enter the following script in Amazon Linux 2 EC2 Userdata. | ||
|
||
```sh: Userdata | ||
#! / bin / bash | ||
curl -L https://raw.githubusercontent.com/newrelic/newrelic-ruby-kata/master/cloud9/userdata.sh | bash | ||
``` | ||
|
||
Connect Cloud9 to the started Instance, | ||
1.kata-download.sh, | ||
2.kata-install.sh, | ||
3.kata-setup.sh | ||
Ruby-kata is set up by executing the above in order. | ||
Running kata-start.sh starts the Kata environment. | ||
|
||
## Japanise | ||
### kataトレーニング環境をセットアップするスクリプト | ||
|
||
Amazon Linux 2 EC2 Userdataに以下のスクリプトを入力します。 | ||
|
||
``` sh:Userdata | ||
#!/bin/bash | ||
curl -L https://raw.githubusercontent.com/newrelic/newrelic-ruby-kata/master/cloud9/userdata.sh | bash | ||
``` | ||
|
||
起動したInstanceにCloud9を接続し、 | ||
1.kata-download.sh、 | ||
2.kata-install.sh、 | ||
3.kata-setup.sh | ||
上記を順番に実行するとRuby-kataがセットアップされます。 | ||
kata-start.sh を実行するとKata環境がスタートします。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
cd /home/ec2-user/newrelic-ruby-kata | ||
|
||
bundle exec rails server -b 0.0.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
yum update -y | ||
amazon-linux-extras install -y epel | ||
yum install -y python3 | ||
yum install -y gcc-c++ openssl-devel git readline-devel | ||
yum install -y openssl-devel readline-devel zlib-devel curl-devel libyaml-devel libffi-devel | ||
yum install -y node.js npm | ||
yum install -y postgresql postgresql-devel postgresql-server postgresql-contrib postgresql-docs | ||
|
||
chmod 755 /home/ec2-user | ||
|
||
sudo -u ec2-user curl -L https://raw.githubusercontent.com/c9/install/master/install.sh | bash | ||
|
||
systemctl enable postgresql.service | ||
postgresql-setup initdb | ||
systemctl start postgresql.service | ||
|
||
sudo -u postgres createuser -s ec2-user | ||
sudo -u postgres createdb ec2-user | ||
sudo -u postgres psql -c "ALTER USER \"ec2-user\" WITH SUPERUSER;" | ||
|
||
sed -i -e "s/host all all 127.0.0.1\/32 ident/host all all 127.0.0.1\/32 trust/g" /var/lib/pgsql/data/pg_hba.conf | ||
|
||
systemctl restart postgresql.service | ||
|
||
git clone https://github.com/qryuu/new-relic-kata-setup.git /home/ec2-user/new-relic-kata-setup | ||
|
||
chown ec2-user.ec2-user -R /home/ec2-user/new-relic-kata-setup |