Skip to content

Commit

Permalink
Merge pull request #1 from The-Island/update
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
sanderpick authored Mar 4, 2017
2 parents e961866 + b0f3d2a commit 217be4b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 97 deletions.
84 changes: 2 additions & 82 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,83 +1,3 @@
### Deployment
#### Island Instagram

##### Setup

Island Instagram runs in production on [AWS Elastic Beanstalk](http://aws.amazon.com/elasticbeanstalk/).

1. Install the [command line interface](http://aws.amazon.com/code/6752709412171743) for EBS. You may also need to install python's boto (``` pip install boto```)
2. Install ruby (```apt-get install ruby``` on Linux)
3. Run ```eb init``` to initialize the Amazon file structure and supply the correct Git commands
4. Modify the file structure at the top-level of your local repo.

```
.aws
aws_credential_file
island.pem
.elasticbeanstalk
config
optionsettings.worker
```

```.aws/aws_credential_file``` : (_Get these values from Sander or Eyal_)

```
AWSAccessKeyId=<YOUR_IAM_ACCESS_KEY_ID>
AWSSecretKey=<YOUR_IAM_SECRET_KEY>
AWSRegion=us-east-1
```

```.aws/island.pem``` : (_Used to ```tail``` logs... get this from Sander or Eyal_)

```.elasticbeanstalk/config``` : (_\<PATH\> must be absolute_)

```
[global]
ApplicationName=island-pubsub
AwsCredentialFile=<PATH>/.aws/aws_credential_file
DevToolsEndpoint=git.elasticbeanstalk.us-east-1.amazonaws.com
EnvironmentName=island-pubsub-env
InstanceProfileName=aws-elasticbeanstalk-ec2-role
OptionSettingFile=<PATH>/.elasticbeanstalk/optionsettings.worker
RdsEnabled=No
Region=us-east-1
ServiceEndpoint=https://elasticbeanstalk.us-east-1.amazonaws.com
SolutionStack=64bit Amazon Linux 2014.09 v1.0.9 running Node.js
```

```.elasticbeanstalk/optionsettings.worker``` :

```
[aws:autoscaling:asg]
MinSize=1
MaxSize=1
[aws:autoscaling:launchconfiguration]
EC2KeyName=island
InstanceType=t2.micro
IamInstanceProfile=aws-elasticbeanstalk-ec2-role
[aws:elasticbeanstalk:application:environment]
AWS_ACCESS_KEY_ID=<YOUR_IAM_ACCESS_KEY_ID>
AWS_SECRET_KEY=<YOUR_IAM_SECRET_KEY>
AWS_REGION=us-east-1
NODE_ENV=production
PUB_SOCKET_PORT=<PUB_SOCKET_PORT>
SUB_SOCKET_PORT=<SUB_SOCKET_PORT>
[aws:elasticbeanstalk:container:nodejs]
GzipCompression=false
NodeCommand=node start.js
NodeVersion=0.10.31
ProxyServer=none
[aws:elasticbeanstalk:hostmanager]
LogPublicationControl=true
[aws:elasticbeanstalk:monitoring]
Automatically Terminate Unhealthy Instances=true
```

##### Shipping

1. Depending on how the EBS Environment was created, it may need to be updated with ```eb update```.
2. Deploy with ```eb push```.
Subscription worker.
4 changes: 2 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"INSTAGRAM_CLIENT_ID": "b6e0d7d608a14a578cf94763f70f1b49",
"INSTAGRAM_CLIENT_SECRET": "a3937ee32072457d92eaa2165bd7dd37",
"INSTAGRAM_VERIFY_TOKEN": "weareinstaisland",
"INSTAGRAM_USER_CALLBACK_URL": "https://island.ngrok.com/api/instagrams/users",
"INSTAGRAM_TAG_CALLBACK_URL": "https://island.ngrok.com/api/instagrams/tags",
"INSTAGRAM_USER_CALLBACK_URL": "https://island.localtunnel.me/api/instagrams/users",
"INSTAGRAM_TAG_CALLBACK_URL": "https://island.localtunnel.me/api/instagrams/tags",
"INSTAGRAM_TAGS": "weareisland:islandio",
"INSTAGRAM_USER": "island_io"
}
18 changes: 7 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,19 @@
"private": true,
"author": "The Island (git://github.com/The-Island)",
"name": "island-instagram",
"version": "0.0.1",
"version": "0.0.2",
"port": 1337,
"repository": {
"type": "git",
"url": "git://github.com/The-Island/island-instagram.git"
},
"dependencies": {
"island-worker": "git+https://island-ebs:[email protected]/The-Island/island-worker.git#develop",
"island-util": "git+https://island-ebs:[email protected]/The-Island/island-util.git#develop",
"underscore": "^1.4.4",
"underscore.string": "~2.3.1",
"step": "0.0.5",
"request": "^2.40.0",
"instagram-node-lib": "^0.1.1"
},
"engines": {
"node": "~0.10.31"
"island-worker": "git+https://github.com/The-Island/island-worker.git#0.0.2",
"island-util": "git+https://github.com/The-Island/island-util.git#0.0.2",
"underscore": "~1.8.3",
"step": "1.0.0",
"request": "~2.79.0",
"instagram-node-lib": "git+https://github.com/sanderpick/instagram-node-lib.git#master"
},
"scripts": {
"start": "./start.js"
Expand Down
3 changes: 1 addition & 2 deletions start.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ var request = require('request');
var util = require('util');
var Step = require('step');
var _ = require('underscore');
_.mixin(require('underscore.string'));
var pack = require('./package.json');
var Instagram = require('instagram-node-lib');

Expand All @@ -31,5 +30,5 @@ worker.start({
});

util.log('Ready for instagrams.');
},
}
}, function (err) { if (err) throw err; });

0 comments on commit 217be4b

Please sign in to comment.