Giter VIP home page Giter VIP logo

backend-service-pattern-travis's Introduction

Hack Oregon Exemplar Backend Service

Purpose

Simple static catalog of the the Hack Oregon service end points to test. You hear that!

Dependencies

  • Docker or Docker toolkit
  • Travis-CI
  • Cluster deployment keys - Contact the DevOps team
  • ECS Service Name - Contact the DevOps team

How to build

1. Create Your Environment file

  • Create env.sh in the project with the following contents:
#! /bin/bash
# Setup Project Specfics - Make sure env.sh is in the .gitignore and .dockerignore
export DOCKER_REPO=<YOUR REPO>
export DOCKER_IMAGE=<the name of your service>
export DOCKER_USERNAME=<YOUR DOCKER Repository USER NAME>
export DOCKER_PASSWORD=<YOUR DOCKER Repository PASSWORD>
export ECS_CLUSTER=<THE NAME OF YOUR ECS CLUSTER>
export ECS_SERVICE_NAME=<THE NAME OF THE SERVICE YOUR DEPLOYING TO>
echo "##############################"
echo  Your Local Project Environment
echo "##############################"
echo DOCKER_REPO: $DOCKER_REPO
echo DOCKER_IMAGE: $DOCKER_IMAGE
echo DOCKER_USERNAME: $DOCKER_USERNAME
echo DOCKER_PASWORD: $DOCKER_PASSWORD
echo ECS_CLUSTER: $ECS_CLUSTER
echo ECS_SERVICE_NAME: $ECS_SERVICE_NAME

2. Setup your local environment

  • Run source env.sh to setup your environment

3. Build the container

  • Run build-proj.sh to build the Container

4. Start the project

  • Run start-proj.sh to view your service's catalog page

Note On service deployer credentials

  • Your service deployment user needs to belong to a group with the following policies:

  • Access to the configuration bucket

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:GetObject",
                "s3:GetObjectVersion"
            ],
            "Resource": "arn:aws:s3:::assign9-config/*"
        }
    ]
}
  • Permissions to deploy to the ECS cluster
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecs:DescribeServices",
                "ecs:DescribeTaskDefinition",
                "ecs:DescribeTasks",
                "ecs:ListTaskDefinitions",
                "ecs:ListTasks",
                "ecs:RegisterTaskDefinition",
                "ecs:DeregisterTaskDefinition",
                "ecs:UpdateService"
            ],
            "Resource": "*"
        }
    ]
}

5. Setup your project in travis

  • Set the following environment variables
 DOCKER_REPO            # Your docker repository
 DOCKER_IMAGE           # endpoint-service
 DOCKER_USERNAME        # Your Docker Repository user name
 DOCKER_PASSWORD        # Your Docker Repository password
 ECS_CLUSTER            # The name of your ECS cluster
 ECS_SERVICE_NAME       # The name of the ECS service your deploying to
 DEPLOY_TARGET          # The deployment environment. Valid values: integration,production
 PROJ_SETTINGS_DIR      # the directory where we will place configuration files(s)
 CONFIG_BUCKET          # The s3 configuration bucket
 AWS_DEFAULT_REGION     # THE AWS region where your cluster is located
 AWS_ACCESS_KEY_ID      # The service deployer keyid for your service
 AWS_SECRET_ACCESS_KEY  # The service deployer secret key for your service

IMPORTANT: Make sure that you don't store AWS or Docker repository credentials in your github repo or expose them in travis

6. Commit

  • Commit and push your code and ensure travis builds and deploys correctly

made changes

backend-service-pattern-travis's People

Contributors

brianhgrant avatar

Watchers

 avatar  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.