Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env...

23
Charlotte Node.js CONTINUOUS CODE DEPLOYMENT 1

Transcript of Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env...

Page 1: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

Charlotte Node.jsCONTINUOUS CODE DEPLOYMENT

1

Page 2: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

Agenda

Introduction

Housekeeping

The Topic

2

Page 3: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

Hello

3

Technology Enthusiast Standup PhilosopherRelentless Startupper

@BmanClt

[email protected]

~bilalsoylu

Bilal SoyluChief Worker Bee @ XcooBee

Page 4: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

Housekeeping Questions

Facilities

Next Meeting

Who wants to help?◦ Co-organizer

◦ Know someone?

4

Page 5: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

The Flow

5

Code CommitCI

PackageDeploy

Any ToolGit

mochajs

Test

AWS Code Commit Solano CI

AWS Code Pipeline

Elastic Bean Stalk

Page 6: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

Setup

6

Page 7: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

Local SetupAWS CLI Tools

Git

Development Stack◦ Node

◦ Libs: Express, Mocha, etc.

◦ IDE (Visual Studio Code)

7

Page 8: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

AWS SetupCode Commit

Elastic Bean Stalk

CodePipeline

8

Page 9: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

Third Party

Solano CI

https://www.solanolabs.com/

paid service: alternative

- Jenkins instance on EC2

9

Page 10: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

Suggested Order of itemsCreate Repo – AWS CodeCommit

Install AWS CLI

Install GIT

Install dev tools and start coding

Create EBS project

Create Solano CI account

Create Code Pipeline

Code Away... And watch the magic

10

Page 11: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

Walk Through and Demo

11

Page 12: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

The RepoInitial Config

◦ Create Repo (us-east-1 only)

◦ Create IAM User◦ Attach Policy: AWSCodeCommitFullAccess.

12

Page 13: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

AWS Command Line Interface◦ Install AWS CLI (1.7.38 or later): aws –-version

◦ Commands to run:

◦ aws codecommit help

◦ aws configure

◦ You can configure profiles (--profile)

◦ You need this to configure Git

13

Page 14: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

GITInstall GIT

◦ Do not install windows credential manager (uninstall needed)

Configure AWS Credential helper◦ git config --global credential.helper "!aws codecommit credential-

helper $@"

◦ git config --global credential.UseHttpPath true

◦ (you can do this per repo as well)

◦ If you use profile:◦ git config --global credential.helper "!aws codecommit

credential-helper --profile CodeCommitProfile $@"

14

Page 15: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

Connect to RepoGet setting from repo page

If you do not have git with global config for use with aws cli of you will not be able to do git clone command. Use these steps:

◦ git init

◦ Run git config for local repo only (remove --global flag)

◦ git remote add origin [your repo url]

◦ git fetch –prune [or run sync in your IDE]

15

Page 16: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

Solano CISetup

◦ 14 days free trial

◦ Auto connect from Code Pipeline

◦ You will also need a GitHub account since AWS uses oauth and Solano uses GitHub as oAuth authenticator

Ensure that you have the solano.yml file in your project root◦ This governs how the project will be build and tested

Testing◦ If webapp make sure your port is higher than 1024 otherwise your tests will

fail (missing root privs)

16

Page 17: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

EBS CautionsDefault Node Versions

Ensure you are going to port 8081 as default, since this is the default nginx proxy port

◦ Via Env variables

◦ Change default port in code or as Env variable. Also disable proxy server if you do not use it.

Configuration of your project matters◦ Use “npm start”

◦ Add index.html

◦ Add logging.config inside .ebextensions directory

17

Page 18: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

Create a CodePipelineWalk through wizard for the initial pipeline.

◦ Connect items◦ CodeCommit

◦ Solano CI

◦ EBS

18

Page 19: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

Conferences

19

Page 20: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

Conferences - Europe

20

Page 21: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

Conferences - NA

21

Page 22: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

Conferences - NA

22

Page 23: Charlotte Nodedownloads.boncode.net/downloads/CharlotteNodeJS... · nginx proxy port Via Env variables Change default port in code or as Env variable. Also disable proxy server if

Q&ANow is the time to ask questions.

23