Code Monkey home page Code Monkey logo

weather-deploy-tutorial's Introduction

##Deploy Node app to AWS EB from Github via Semaphore

This is a sample Node app to deploy to AWS Elastic Beanstalk directly from Github. I could not find a good tutorial, so sharing here.

Deployed app: http://default-environment.ycn9jgnj6p.us-west-2.elasticbeanstalk.com/

If you are looking for tutorial on how to deploy Meteor app fto Digital Ocean with Mup tool and Letsencrypt, check up this repository: https://github.com/tima101/meteor-deploy-letsencrypt

If you are building Adblock Detector, check this repo: https://github.com/tima101/Native-adblock-detector

If you are building Paywall/Membership software, stay tuned, we are in the process of open-sourcing one.

#Setting up sample app on AWS EB Go to the welcome page of AWS ElasticBeanstalk. At "Select a platform", choose Node and click "Launch now". Setting up environment and sample app will take 2-3 minutes. Sample app will be created with pre-defined default settings. You can click "Create new application" and fine-tune settings manually. At the end, you will see dashboard of your application: screen shot 2017-03-10 at 9 52 56 am

Go to the application's URL (something like: Default-Environment.ycn9jgnj6p.us-west-2.elasticbeanstalk.com), confirm that your app is live and well: screen shot 2017-03-10 at 10 27 28 am

#Giving Semaphore access to Github Upload your app to Github, no need to upload node_modules, make sure to include package.json. You will be able to specify build commands, such as npm install, on Semaphore. This repo contains a sample app, ready for deploy.

Next step is authorize Semaphore to access your code on Github. Follow this simple steps:

Create new project on Semaphore.

Where is your repository hosted? Select: Github

Let Semaphore access: Select: All repos

You'll be redirected to typical OAuth screen, click "Authorize application"

Select repository. Select repo for deploy from the list of all repos.

Select branch. Select branch for deploy from the list of all branches. I deploy from master branch in this example.

Create organization. Specify name for your organization and click "Create".

In the section "Preparing for deploy", we will prepare project for deploy by specifying build commands and etc in "Project settings".

#Giving Semaphore AWS EB user permission On AWS dashboard, go to "My Security Credentials", click "Users", click "Add user": screen shot 2017-03-10 at 1 56 26 pm

Create new user, click "Users" to bring list of existing users.

Click on newly created user and go to "Permissions", click "Add permissions", click "Add existing policies directly", from the list "Policy time" select ElasticBeanstalkFullAccess.

Click on newly created user, go to "Security Credentials", create new Access key ID. You will need this "Access key ID" and "Secret Access Key" later, to give Semaphore permission to your AWS EB server:

screen shot 2017-03-10 at 2 12 57 pm

In the next two sections, we will prepare Semaphore project for deploy.

#Preparing project on Semaphore for deploy. Part 1

Go to Semaphore. Select existing project. Click "Add new server".

Select "AWS Elastic Beanstalk". Then select "Automattic".

Select branch, select "master" if you plan to deploy from master branch.

Next, add "Access key ID", "Secret Access" Key and "Region" (for example us-west-2).

At this point Semaphore talks to AWS. Next, select "Application name", "Environment name" and "S3 Bucket name".

Finally, give your Semaphore server name and click "Create server".

#Preparing project on Semaphore for deploy. Part 2

On Semaphore, click "Project settings". Specify build settings and commands as shown below: screen shot 2017-03-10 at 2 22 30 pm

Specify location of package.json file. If file is located at the root folder, just type package.json in the field and click "Save". screen shot 2017-03-10 at 2 24 16 pm

In your package.json file, make sure to add "start" attribute and its value:

"scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node server.js"
  }

Go back to Semaphore project, initiate your Build, if Build is successful, Deploy will be initiated automatically. Since you've selected "Automatic" while setting up Semaphore server, every successful build will result in Deploy.

weather-deploy-tutorial's People

Contributors

tima101 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.