GithubHelp home page GithubHelp logo

mahaelleci / aws-wercker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amrdraz/aws-wercker

0.0 2.0 0.0 975 KB

Build and Deploy your applications to OpenShift using two popular hosted continuous integration services, Travis CI and Wercker

License: GNU General Public License v2.0

JavaScript 100.00%

aws-wercker's Introduction

Wercker AWS CI CD example App

wercker

  • Fork this repository

  • Setup a wercker account and have it point to the repo you just forked

create_account

  • go to the app settings and create an ssh key

create ssh

  • add your public key in your aws instance's authorized_keys file
$ ssh YOUR_USER@YOUR_SERVER_IP
$ vi ~/.ssh/authorized_keys

past the public key you got from wercker into the next line

  • go back to your wercker settings and create a deployment target called aws (doesn't have to be but we will do that)

add ssh

  • Add variables into your target

  • add the ssk key as a variable in your deployment target calling it SSH_KEY create_account

  • add the variable your HOST, your USER, your REPO_URL and the name of your APP as variables as well

add variable

You should windup with a target that looks something like this

variables

Don't forget to Save

Add update_server.sh file into your server's home (you already did that if you're coming from the se-tutrial lab)

This file assumes you're using nvm and pm2

#!/bin/bash

[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh
nvm use 5.9
if [ ! -d "$APP" ]; then
   git clone "$REPO_URL" "$APP"
   cd "$APP"
else
   cd "$APP"
   git pull origin master -f
fi

npm install
cd ..
pm2 stop all
pm2 start "$APP"

exit 0
$ chmod u+x update_server.sh

make sure port 80 is open otherwise you should add a port variable to the script and declare it before running the app

sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
sudo iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT
sudo apt-get install libcap2-bin
sudo setcap cap_net_bind_service=+ep /usr/local/bin/node

Now your setup should be ready

  • To test this out simply clone this repo
  • and change in it (say change the welcome message)
  • then add commit and push it to master

After that checkout the app on wercker

build

the wercker.yml file is explained back in the se-tutrial lab

This repo is based off of these tutorials https://botleg.com/stories/build-and-deploy-to-openshift-with-travisci-and-wercker/ http://blog.wercker.com/2013/09/03/ContinuousDelivery-with-wercker-digitalocean-and-nodejs.html

you may use it to figure out if some information is missing.

aws-wercker's People

Contributors

amrdraz avatar hanzeljesheen avatar

Watchers

James Cloos avatar Maha Ehab Elleci 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.