Setup Godaddy & Route 53

I registered a domain with godaddy but i want to manage it with route53 so, i'm going to go to Route 53 click "Create Hosted Zone" and under the Domain name i'm going to place the domain i registered wich is ravelo.com.

Once created, I'm going to copy the NameServer (NS) values and go to godaddy > Manage Domains > ravelo.ca > Manage DNS and under "Nameservers" i will change the values by using the values in the NS records above!

AWS Code Commit + Code Build + S3

The objective with this is to get a react app build, tested and stored its artifact by using AWS awesome services. For the purpose of this document i'm going to accomplish the following:

  • Install npm dependencies
  • Test app
  • Build artifact
  • Store Artifact (.zip) in S3 (overwrite if build happens multiple times)

AWS Code Commit

As a AWS fan, i'm going to use CodeCommit just to host my code. So the first thing i do is, to make sure that you can clone the repo. I created my SSH keys by doing the following:

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

called my ssh keys aws-awesomeness. Next i went to IAM > users > {my-user} > Security Credentials and clicked the "Upload SSH Public Key" and pasted the value in the aws-awesomeness.pub. Once you save it, it will generate an {SSH-KEY} that you will need when when you update the ~/.ssh/config file with the following content:

Host git-codecommit.*.amazonaws.com
  User {SSH-KEY}
  IdentityFile ~/.ssh/keys/aws-awesomeness

Once you go to Code Commit and create a repo, clone it in your local:

git clone ssh://git-codecommit.us-west-2.amazonaws.com/v1/repos/{repo-name.com}

and you should be able to move forward to building your react app (make sure you write tests for it).

AWS S3

I'm going to have a bucket where i'm going to place all my react apps. For the sake of this and i will call it react-apps (it's already taken).

Code Build

Now i want to be able to build .zip artifacts that i will store in my react-apps bucket so i will now go to Code Build and create the "Create Project" button. I'm going to call this project same as the repo with the build sufix (repo-name.com-build).

  • Project Name: repo-name-com-build
  • Source provide: AWS CodeCommit
  • Repository: repo-name.com
  • Environment image: Use an image managed by AWS CodeBuild
  • Operative System: Ubuntu
  • Runtime: Node.js
  • Version: aws/codebuild/nodejs:6.3.1
  • Build specification: Insert build commands
  • Build Command: npm install && npm test && npm run build
  • Artifacts Type: Amason S3
  • Name: repo-name.com-build.zip
  • Namespace type: None
  • Bucket Name: react-apps
  • output files: build/**/*
  • Service Role: codebuild-repo-name.com-service-role

If you decide to have a file in your repo to configure the build it would look like this:

version: 0.2

phases:
  install:
    commands:
      - npm install
  pre_build:
    commands:
      - npm run ci-test
  build:
    commands:
      - npm run build

artifacts:
  files:
    - 'build/**/*'

Click Continue, review and hit "save and build". It should take you to a page where it asks you for the branch. Select master (for this first build) and the hit continue. If everything went well, at the end of the process, you should be able to go to the

SCP Reminder

It's been some time since the last time i used scp to download files so i'm going to take advantage to write down what i need to do. I've got my ssh key setup to be able to connect to the server without password (won't describe how to do that here) and my config is setup knows how to associate my ssh key with the example-server.com server so:

scp example-server.com:/tmp/file-a.txt ~/

And that's it! next time i forget, i'll know where to look for when it comes to downloading files with scp.

GitHub – opposite-bracket

Jesus Rodriguez

Vancouver, BC