Code Monkey home page Code Monkey logo

opsworksenvy's Introduction

OpsWorksEnvy

environment_variables

Set environment variables for your environment and Node.js OpsWorks project.

You can do 2 things:

  • Sets environment variables for machine
    • To make it work specify your variables, enable Custom Chef Recipes and include "environment_variables::configure" recipe to the "configure" section of your application layer
  • Sets environment variables for Node.js process
    • Same as above, but no need to include custom recipe's; Default OpsWorks monitrc file will be overwritten and environment variables will be passed to Node.js process

To set environment variables specify custom Chef JSON with required key/value pairs.

E.g.

{
  "environment_variables": {
    "NODE_ENV": "production"
  },
  "deploy": { 
    "app_name": {
      "environment_variables": {
        "NODE_ENV": "production",
        "ENV_1": "value_of_env_1",
        "ENV_2": "value_of_env_2"
      }
    }
  }
}

In JSON above first "environment_variables" sets environment variables for machine (user root). The section "environment_variables" under "deploy" specifying environment variables for Node.js process which will be hit with "monit restart app_name".

data_backup

The utility to run backup on the certain interval. Currently supports MongoDB only. Data is being written from one database to another. Example scenario: data from production database is copied to development database every week.

Database options are set through environment variables. Available options:

  • BACKUP_TMP_PATH - the temporary location on the disk where backup will be performed
  • BACKUP_SRC_DB_NAME - the name of the source database
  • BACKUP_DST_DB_NAME - the name of the source database
  • BACKUP_COLLECTIONS - space separated list of collections to backupo
  • BACKUP_SRC_HOST - connection string for MongoDB SOURCE host
  • BACKUP_DST_HOST - connection string for MongoDB DESTINATION host

Schedule is set through custom JSON:

  • BACKUP_SCHEDULE_HOUR - which our to run the tool
  • BACKUP_SCHEDULE_MINUTE - which minute to run the tool
  • BACKUP_SCHEDULE_WEEKDAY - which day of the week to run the tool Default is: run backup every saturday at 1AM

Custom Chef cookbook JSON example:

{
	"data_backup": {
		"BACKUP_SCHEDULE_HOUR": "16",
		"BACKUP_SCHEDULE_MINUTE": "0",
		"BACKUP_SCHEDULE_WEEKDAY": "2"
	},
	"environment_variables": {
		"BACKUP_TMP_PATH": "/tmp/dump",
		"BACKUP_SRC_DB_NAME": "my_mega_database",
		"BACKUP_DST_DB_NAME": "my_dev_database",
		"BACKUP_COLLECTIONS": "users shops streets",
		"BACKUP_SRC_HOST": "mongodb://my_super_production_database",
		"BACKUP_DST_HOST": "mongodb://my_not_as_super_development_database"
	}
}

opsworksenvy's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

opsworksenvy's Issues

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.