Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
M
marketplace
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 0
    • Merge Requests 0
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

and though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here

  • Confidential and Proprietary
  • BlocPower
  • marketplace
  • Wiki
  • Deployment

Last edited by Jose Daniel Contreras May 16, 2016
Page history
This is an old version of this page. You can view the most recent version or browse the history.

Deployment

Command Line Tools Requirements:

  • MYSQL CLI
  • WP CLI
  • AWS CLI
  • EB CLI

Deployment to Staging

  1. Dump SQL from Production RDS instance and backup to S3

    mysqldump --host=$PROD_RDS_HOSTNAME --port=$PROD_RDS_PORT --user=$PROD_RDS_USER --password=$PROD_RDS_PASSWORD --add-drop-table marketplace > proddump-{git-commit-hash}.sql  
    aws s3 cp proddump-{git-commit-hash}.sql s3://blocpower.us.builds/marketplace/sql/proddump-{git-commit-hash}.sql  
  2. Backup uploads from production in S3

    ssh ec2-user@$EC2_IP -i ~/.ssh/EastCoastBPKey  
    cp /var/app/current/wp-content/uploads/ uploads/
    cd uploads  
    zip -r uploads-{git-commit-hash}.zip .  
    aws s3 cp uploads_current/uploads.zip s3://blocpower.us.builds/marketplace/wordpress/uploads.zip  
    cd ..  
    rm -r uploads  
    exit  
  3. Restore data from SQL dump and add images from zip with current uploads.

    mysql --host=$RDS_HOST --user=$RDS_USER --port=$RDS_PORT --password=$RDS_PASSWORD marketplace < proddump-{git-commit-hash}.sql  
    rm proddump-{git-commit-hash}.sql
    cd $APPROOT  
    wp search-replace "http://blocpower.us" "http://staging.marketplace.blocpower.us"  
    wp search-replace "http://www.blocpower.us" "http://staging.marketplace.blocpower.us"  
    mysqldump --host=$RDS_HOSTNAME --port=$RDS_PORT --user=$RDS_USER --password=$RDS_PASSWORD --add-drop-table marketplace > stagingdump-{git-commit-hash}.sql  
    mysql --host=$STAGING_RDS_HOST --user=$STAGING_RDS_USER --port=$STAGING_RDS_PORT --password=$STAGING_RDS_PASSWORD marketplace < stagingdump-{git-commit-hash}.sql  
    aws s3 mv stagingdump-{git-commit-hash}.sql s3://blocpower.us.builds/marketplace/sql/stagingdump-{git-commit-hash}.sql`  
    cd $APP_ROOT  
    aws s3 cp s3://blocpower.us.builds/marketplace/wordpress/uploads-{git-commit-hash}.zip wp-content/uploads/uploads-{git-commit-hash}.zip  
    cd wp-content/uploads/
    unzip uploads-{git-commit-hash}.zip  
    rm uploads-{git-commit-hash}.zip  
  4. Deploy Elastic Beanstalk Application

    cd $APP_ROOT
    zip -r marketplaceBuild.zip .   
    eb deploy  

Deployment to Production

  1. Go to marketplace application versions page.
  2. Select applicatiion version that staging is running
  3. Hit the deploy button and selected production environment for deployment
Clone repository
  • Continuous Deployment and Continuous Integration
  • Custom Fields & User Editor Plugin Setup
  • Deployment
  • Home
  • Running Locally
  • Stack
  • Testing