New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

amico-db

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amico-db

  • 0.1.8
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Ruby

Amico Db

Import mysql db from docker container.

Requirements

Docker container

To use this tool you need a docker container on the server with your db.

Pipeline

For visualize progress on the cli you need to install pv: https://man7.org/linux/man-pages/man1/pv.1.html.

# Install PV in your Dockerfile
RUN apt-get update && apt-get install -y pv
RUN apt-get update && apt-get install -y mariadb-client

Installation

Add this line to your application's Gemfile:

gem 'amico-db', git: 'https://github.com/rubynetti/amico-db.git'

Configuration

For example inside a rails initializer (config/initializers/amico-db.rb).

dev = Rails.configuration.database_configuration["production"]
production = Rails.configuration.database_configuration["production"]

AmicoDb.configure do |config|
  config.ssh_user = 'root'
  config.host = 'your_host'
  config.remote_app_path = '/var/www/yourproject'
  config.folder_dump = '/dumps/db.sql'
  config.local_path = './dumps/db.sql'

  config.db_name = production['database']
  config.db_user = production['username']
  config.db_dev_dbname = dev['database']
  config.db_dev_username = dev['username']
end

Docker Dev Configuration (docker-compose.development.yml)

Your dev configuration need to copy ssh folder inside. Example:

services:
  web:
    build: .
    command: ['rails', 'server', '-b', '0']
    volumes:
      - .:/app
      - ~/.ssh:/home/rails/.ssh

Docker Production Configuration (docker-compose.production.yml)

Database service need MYSQL_ROOT_PASSWORD and share dumps folder.

services:
  db:
    environment:
      - MYSQL_ROOT_PASSWORD=$DB_PASSWORD
    volumes:
      - ./dumps:/dumps

Usage

rake db:dump
rake db:import_from_staging
rake db:import_from_sql (importa sql da dumps/db-staging.sql)

For development of this gem with Docker

  • docker-compose up run rake test command

FAQs

Package last updated on 17 Sep 2020

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