Skip to content

DevOps: Run rails tasks from a VAEC Jenkins Instance

elisa lee edited this page Sep 15, 2020 · 4 revisions
  1. Have an account
  2. Browse to http://internal-dm-devops-523064655.us-gov-west-1.elb.amazonaws.com/
  3. Log in
  4. Click on "Task"
  5. Click on "Configure" from the side navigation
  6. Scroll down to "Build"
  7. In the "Execute shell" section and "Command" textarea, type the following command
ssh ec2-user@[SERVER VARIABLE] "sudo docker exec [CONTAINER NAME] rails [RAKE TASK COMMAND];"

Replace [SERVER VARIABLE] with the variable of the server you want to run this task on:

  • production: $PROD_SERVER
  • staging: $STG_SERVER
  • development: $DEV_SERVER

Replace [CONTAINER NAME] with the name of the docker container for the application: diffusion-marketplace_app_1

Replace [RAKE TASK COMMAND] with the name of the task you want to run. For a full list of available tasks, you can run rake --tasks in your local project folder.

  • ex: milestones:port_milestones_to_timelines

So an example command would look like this:

ssh ec2-user@$DEV_SERVER "sudo docker exec diffusion-marketplace_app_1 rails milestones:port_milestones_to_timelines;"
  1. Click "Save"
  2. Click "Build Now"
  3. Click the task number in the "Build History"
  4. Click "Console Output"
  5. Ensure you see "SUCCESS" in the logs
Clone this wiki locally