Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Media Temple Pipeline Recipe

Matt
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 31, 2018

I'm a bit confused on how I can use pipelines with my Media Temple server where I can manually trigger a deployment of all new files from stage to my server.

For example, there might be some new yarn packages that need updating every now and then. So I'm guessing I'd check for package.json and run yarn install and or Composer packages so running composer install also needs to be run.

1 answer

1 accepted

0 votes
Answer accepted
Tom Bradshaw
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 10, 2018

Hi @Matt,

It sounds like you want to run a custom pipeline to update your Media Temple server in the shortest possible time (based on your requirement to only update modified or new files)

Using rsync should allow you to update the remote Media Temple server. For more information you can consult the 'Rsync' portion of https://mediatemple.net/community/products/dv/204643550/common-ssh-commands#4

Your bitbucket-pipelines.yml should look something like this (although with rsync parameters changed to refer to your specific files)

pipelines:
custom:
update-media-temple:
- step:
script:
- apt-get update && apt-get install rsync -y
- rsync -avz <local_directory> <username>@<remote_host>:<destination_directory>

The custom section defines pipelines that are run only manually or using a schedule, both accessed through the UI, as opposed to a build that runs on every new commit to a branch.

Rsync will by default only update those files that have been added or changed. It is not installed on our default build agent hence the apt-get install step.

Cheers,

Tom

Matt
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 15, 2019

Hey @tom

 

Thank you for this. I went ahead and made the necessary edits to my version of the pipeline yaml file like so:

pipelines:
custom: deployment-to-stage:
- step: name: rsync to stage
deployment: staging # can be test, staging or production.
trigger: manual
script: - apt-get update && apt-get install rsync -y - rsync -zrSlh --stats --exclude-from==deployment-exclude-list.txt $BITBUCKET_CLONE_DIR/ $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_STAGE_PATH

I am having a problem with setting the deployment to trigger manually. On this screen: /addon/pipelines/deployments

I am getting an error `The first step of a pipeline can't be manually triggered` All the comments that I've read said if I make it "custom" like you have also included in the file I can trigger this deployment manually.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events