You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

询问VSTS发布环节是否支持SSH推送WordPress仓库至wpengine

Pushing WordPress Repo from VSTS to WP Engine via SSH

Hey there, let's break down how to get your WordPress repository from VSTS (now officially Azure DevOps) pushed to WP Engine using SSH. The bad news is VSTS doesn't have a built-in, dedicated task for WP Engine deployments via SSH—but the good news is we can use existing tasks and scripts to make this work smoothly.

Option 1: Use VSTS's Built-in SSH Task

VSTS has a native SSH task that lets you run commands directly on a remote server. Here's how to set it up for WP Engine:

  1. Create an SSH Service Connection:
    • Go to your VSTS project > Project Settings > Service Connections > New service connection > SSH.
    • Fill in WP Engine's Git server details:
      • Server URL: git.wpengine.com
      • Username: Your WP Engine Git username (found in your WP Engine dashboard under Git settings)
      • Authentication method: Choose SSH key (recommended) and upload your private key (make sure the corresponding public key is added to your WP Engine account).
  2. Add the SSH Task to Your Release Pipeline:
    • In your release pipeline, add an SSH task from the task library.
    • Select the SSH service connection you just created.
    • In the Commands field, enter the Git push command tailored to your setup:
      # If you need to initialize the repo connection first (one-time setup)
      git remote add wpengine git@git.wpengine.com:your-account-slug/your-site-slug.git
      # Push your branch (WP Engine typically uses master for production)
      git push wpengine your-vsts-branch:master
      
    • Note: If you're using VSTS's hosted agents, double-check that WP Engine's Git server is accessible from their network. If you hit connectivity issues, switch to a self-hosted agent that can reach WP Engine.

Option 2: Use Git Tasks with SSH Key Authentication

If you prefer working directly with Git commands in VSTS, you can configure SSH key auth via secure files:

  1. Store Your SSH Private Key in VSTS:
    • Go to your VSTS project > Pipelines > Library > Secure files > + Secure file.
    • Upload your private SSH key (the one paired with the public key in WP Engine).
  2. Add Tasks to Your Release Pipeline:
    • First, add a Download secure file task to pull your private key onto the agent machine.
    • Then, add a Command line task to set up SSH auth and push the repo:
      # Start the SSH agent
      eval `ssh-agent -s`
      # Add your private key to the agent
      ssh-add $(Agent.TempDirectory)/your-private-key-filename.pem
      # Add WP Engine as a remote (if not already configured)
      git remote add wpengine git@git.wpengine.com:your-account-slug/your-site-slug.git
      # Push your code
      git push wpengine your-vsts-branch:master
      

Critical Notes to Avoid Headaches

  • WP Engine Prep: Make sure you've already enabled Git access for your WP Engine site and added your public SSH key to your WP Engine user account.
  • Sensitive Files: Don't include wp-config.php or database credentials in your VSTS repo—keep these on the WP Engine server directly (they're managed separately in their dashboard).
  • Branch Mapping: WP Engine uses specific branch conventions (usually master for production, staging for staging sites). Double-check your branch names match what WP Engine expects.

内容的提问来源于stack exchange,提问作者MaxRev17

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 07:19:09