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

nexus_seed

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nexus_seed

  • 0.2.30
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

nexus_seed

Common rails application seeding logic.

Seed development

See SEED_BUILDER documentation.

Running

Running tasks on deploy

Task files must be placed in /lib/tasks/seed_#{name}.rake

Set task name in helm values e.g. for a common seed task:

helm:
  values:
    rails:
      seedTasks:
        - common

Configure the post deploy hook in devspace.yaml and set COMPONENT appropriately:

hooks:
  - name: post-deploy-seed-task-hook
    events: [ "after:deploy" ]
    command: |-
      docker run --rm --pull always registry.nexusmods.com/nexus-mods/devops/tools/seed_task_start:stable cat seed_task_start.sh |
      NAMESPACE=${devspace.namespace} COMPONENT=api bash

Running tasks manually

Run common seed task with default options:

bundle exec rake seed_common:run

Options are [:retry_limit, :sleep_interval]

E.g. to retry 100 times every 3 seconds:

bundle exec rake seed_common:run[100,3]

Removing seeded data

Use NEXUS_SEED_DESTROY env var to locate seeded data and remove it.

Especially useful when developing seeds, run with destroy and then run again without.

NEXUS_SEED_DESTROY=true bundle exec rake seed_common:run

Local gem development

Steps to run this gem from local sources in one the nexus 'staged build' rails components:

Copy gem sources to component

cd ~/nexus-api
cp -r ../nexus_seed .

Adjust component Dockerfile to include gem sources

Within stage 1, append a COPY after the Gemfile copy:

COPY --chown=nexus:nexus Gemfile* ./
COPY --chown=nexus:nexus nexus_seed/ ./nexus_seed/

Within stage 2, append a COPY after the bundle copy:

COPY --from=stage1 /usr/local/bundle /usr/local/bundle
COPY --from=stage1 /app/nexus_seed/ /app/nexus_seed/

Adjust Gemfile to use local path

gem 'nexus_seed', :path => "/app/nexus_seed"

FAQs

Package last updated on 06 Jul 2023

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