sh deploy.sh

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh deploy.sh相关的知识,希望对你有一定的参考价值。

  
  ## These variable should be set in Bitbucket repository
  ## If you want to try in local system without bitbucket pipeline
  ## You can do so with update variable value
  ## One thing is required collect Aws ssh key for ssh connect
  ## Create a ssh key in Aws server and add public key in your bitbucket account
  ## Otherwise this code will not work

  # export WP_PROD_ROOT_PATH="/var/www/html/pipelines/wp-testing";\
  # export DB_NAME_PROD="wppipelineprod";\
  # export DB_USER="root";\
  # export DB_PASS="123456";\
  # export WP_PROD_ROOT_URL="http://domain/wp-prod";\
  # export AWSDOMAINANDUSER="ec2-user@awsdomain";\
  # export GITURL="git@bitbucket.org:username/wp-pipeline.git";\
  # export LOCALURL="http://localhost/wp-pipeline";\

  ## End Bitbucket variable


ssh $AWSDOMAINANDUSER '
  export WP_PROD_ROOT_PATH="'$WP_PROD_ROOT_PATH'";\
  export DB_NAME_PROD="'$DB_NAME_PROD'";\
  export DB_USER="'$DB_USER'";\
  export DB_PASS="'$DB_PASS'";\
  export WP_PROD_ROOT_URL="'$WP_PROD_ROOT_URL'";\
  export GITURL="'$GITURL'";\
  export LOCALURL="'$LOCALURL'";\

  if [ wp core version --path=$WP_PROD_ROOT_PATH ]
  then
    echo "already Setup"
    
  else
    echo "Setup starting" ;\
    
    eval `ssh-agent -s`
    ssh-add ~/.ssh/id_rsa

    git clone $GITURL $WP_PROD_ROOT_PATH --progress ; \

    wp core download --path=$WP_PROD_ROOT_PATH; \
    wp core config --dbname=$DB_NAME_PROD --dbuser=$DB_USER --dbpass=$DB_PASS --dbhost=localhost --path=$WP_PROD_ROOT_PATH; \
    wp db create --path=$WP_PROD_ROOT_PATH; \
    wp db import $WP_PROD_ROOT_PATH/db/db.txt --path=$WP_PROD_ROOT_PATH; \
  fi


  wp search-replace $LOCALURL $WP_PROD_ROOT_URL --path=$WP_PROD_ROOT_PATH; \

  ';

以上是关于sh deploy.sh的主要内容,如果未能解决你的问题,请参考以下文章

sh rancher-deploy.sh

sh deploy.sh

sh deploy_production.sh

sh github-deploy-clone.sh

无法在 Laravel 项目中使用 deploy.sh 文件运行“npm run prod”(使用 Laravel Mix)

常用Linux命令包括vi svn