Skip to content

Commit

Permalink
Partial EC2 deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
hoang-ho committed Mar 13, 2021
1 parent 04ee26a commit b32d86c
Show file tree
Hide file tree
Showing 19 changed files with 31 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea/
.gradle/
build/
.DS_Store
.DS_Store
ec2-user*
Empty file modified Args.txt
100644 → 100755
Empty file.
Empty file modified Config.txt
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified build.gradle
100644 → 100755
Empty file.
Empty file modified doc/doc.md
100644 → 100755
Empty file.
31 changes: 29 additions & 2 deletions doc/test/test.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
cd ,,/..

echo "This script is to run the test!"
echo ""
echo "Make sure that you have configure AWS access key!"
echo ""
echo "Create a key-pair 677kp if you haven't"
echo ""
echo "If you encounter any issue with running aws, try troubleshooting with this https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html#TroubleshootingInstancesConnectingSSH"
echo ""
echo "Let's start!"

# Compute the code
cd ../..

./gradlew clean build

# Configure the network
gradle p2pConfigure

# Start an EC2 instance
aws ec2 run-instances --image-id ami-0fc61db8544a617ed --instance-type t2.micro --key-name 677kp > instance.json

# Get instance Id
InstanceId=$(grep '^ *"InstanceId":' instance.json | awk '{ print $2 }' | sed -e 's/,$//' -e 's/^"//' -e 's/"$//')

aws ec2 describe-instances --instance-id $InstanceId > runningInstance.json

PublicDnsName=$(grep -m 1 '^ *"PublicDnsName":' runningInstance.json | awk '{ print $2 }' | sed -e 's/,$//' -e 's/^"//' -e 's/"$//')

scp -i "677kp.pem" Config.txt ec2-user@$PublicDnsName

ssh -i "677kp.pem" ec2-user@$PublicDnsName
Empty file modified doc/testVerify.md
100644 → 100755
Empty file.
Empty file modified gradle/wrapper/gradle-wrapper.jar
100644 → 100755
Empty file.
Empty file modified gradle/wrapper/gradle-wrapper.properties
100644 → 100755
Empty file.
Empty file modified gradlew.bat
100644 → 100755
Empty file.
Empty file modified settings.gradle
100644 → 100755
Empty file.
Empty file modified src/main/java/com/p2p/configure/ConfigureNetwork.java
100644 → 100755
Empty file.
Empty file modified src/main/java/com/p2p/configure/Runner.java
100644 → 100755
Empty file.
Empty file modified src/main/java/com/p2p/grpc/Buyer.java
100644 → 100755
Empty file.
Empty file modified src/main/java/com/p2p/grpc/Peer.java
100644 → 100755
Empty file.
Empty file modified src/main/java/com/p2p/grpc/PeerImpl.java
100644 → 100755
Empty file.
Empty file modified src/main/java/com/p2p/grpc/Seller.java
100644 → 100755
Empty file.
Empty file modified src/main/proto/Interfaces.proto
100644 → 100755
Empty file.

0 comments on commit b32d86c

Please sign in to comment.