Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

handsome_fencer-circle_c_i

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

handsome_fencer-circle_c_i

  • 0.1.44
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

HandsomeFencer::CircleCI

This gem provides developers a handsome way of deploying applications using Docker, CircleCI, and the server of their choice. It's written in Ruby, uses Thor, and admires the Rails philosophy of convention over configuration.

Usage

Once installed, handsome_fencer-circle_c_i gives you a CLI with four commands -- install, generate_key, obfuscate, and expose:

$ handsome_fencer-circle_c_i --help

Installation

If you just need to generate keys, obfuscate, or expose, environment files:

$ gem install handsome_fencer-circle_c_i

Using install command with Docker and Docker Compose

If you wish to use the install command, you'll need Docker and Docker Compose installed.

installing Docker installing Docker Compose

Once you can do:

$ docker-compose -v

...and see output similar to:

$ docker-compose -v
docker-compose version 1.21.0, build 5920eb0

...You are now ready to either a) greenfield a handsome new app or b) handsomize an existing one.

Greenfielding a fully dockerized Rails application:

  1. Create a directory named after your new, greenfield app and change into that directory:
$ mkdir -p sooperdooper
$ cd sooperdooper

  1. Execute the dockerize command:
$ handsome_fencer-circle_c_i dockerize

You will be prompted with a number of questions. For demonstration purposes and to accept the defaults, hit enter at each prompt without answering, and again hit enter when asked if you'd like to over-write files.

  1. Ask Docker to 'run' the 'rails new' command inside our 'app' container to generate a rails app in '.' (our current directory), with a flag specifying our 'database' as 'postgresql' and another flag so it will 'skip' over-writing our previously generated files:
$ docker-compose run app rails new . --database=postgresql --skip

3a) If you're on a linux machine, you may need to chown the newly created files:

$ sudo chown <username><user group> -R .

If that doesn't work, Docker's documentation should get you pointed in the right direction.

  1. Ask Docker to build the necessary images for our app and spool up containers using them:
$ docker-compose up --build
  1. Now we need to ask Docker to execute a command on the container we asked Docker to run in the previous step. Issue the following command in a new terminal:
$ docker-compose run app bin/rails db:create db:migrate

You should now be able to see the Rails welcome screen upon clicking http://localhost:3000/.

Dockerizing an existing Rails application:

  1. Execute the install command:
$ handsome_fencer-circle_c_i dockerize
  1. You'll be asked which files to write over. Keep your Gemfile and let it write over everything else, including your .gitignore, any existing docker-compose.yml, .circleci/config.yml, and Gemfile.lock files.

  2. Ask Docker to build the necessary images for our app and spool up containers using them:

$ docker-compose up --build

If you're on a linux machine, you may need to chown the newly created files using:

$ sudo chown <username><user group> -R .

If that doesn't work, Docker's documentation should get you pointed in the right direction.

  1. Ask Docker to set up your database by executing the following commands inside the app container:
$ docker-compose exec app bin/rails db:setup

You should now be able to see your app running upon clicking http://localhost:3000/.

Contributing

This gem and the associated practices are just a way of deploying your application, not the canonical or best way. If you have suggestions on how to make it easier, more secure, quicker or better, please share them. If you have specific ideas, please fork the repo, make your changes, write your tests, and send me a pull request.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 22 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc