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

Deployment · Changes

Page history
Updated Deployment (markdown) authored May 16, 2016 by Jose Daniel Contreras's avatar Jose Daniel Contreras
Hide whitespace changes
Inline Side-by-side
Showing with 1 addition and 51 deletions
+1 -51
  • Deployment.md Deployment.md +1 -51
  • No files found.
Deployment.md
View page @ 5541aa9c
Command Line Tools Requirements:
* MYSQL CLI
* WP CLI
* AWS CLI
* EB CLI
# Deployment to Staging # Deployment to Staging
1. Dump SQL from Production RDS instance and backup to S3 From the our Jenkins deployment site there is a job ([http://deployment.blocpower.us/job/marketplace-staging/](http://deployment.blocpower.us/job/marketplace-staging/)). Starting the job builds and deploy to staging.
```
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 # Deployment to Production
......
Clone repository
  • Continuous Deployment and Continuous Integration
  • Custom Fields & User Editor Plugin Setup
  • Deployment
  • Home
  • Running Locally
  • Stack
  • Testing