Skip to content

Instantly share code, notes, and snippets.

@engineersamuel
Last active March 10, 2020 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save engineersamuel/d8999bed0bf5024e373471a805525e3f to your computer and use it in GitHub Desktop.
Save engineersamuel/d8999bed0bf5024e373471a805525e3f to your computer and use it in GitHub Desktop.
Managing remote docker-compose with Azure DevOps Deployment Groups

Introduction

This blog will detail how to manage remote docker-compose instances with Azure Devops Deployment groups.

I'm going through https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/containers/acr-template?view=azure-devops as a template.

I'm using AzureDevops https://dev.azure.com/, when I signed up it automatically created a project {FirstName}{LastName} for me.

Under Pipelines click Deployment Groups and create a new Deployment Group. You'll need to copy the script and run it on the machine in question. That could be a VM, for this blog I'm testing on my personal laptop.

In Azure DevOps create a new project, I named it helloworld.

Using the repo https://github.com/MicrosoftDocs/pipelines-javascript-docker as the template

git clone https://github.com/MicrosoftDocs/pipelines-javascript-docker

Under Repos in Azure DevOps you can "Push an existing repository from command line" (use ssh): Example:

git remote add origin git@ssh.dev.azure.com:v3/SamuelMendenhall/SamuelMendenhall/SamuelMendenhall git push origin master

Now refresh the repository and you'll see the repo and click "Set up build"

Choose the docker to acr, go through the steps, save and commit it to master, and pull down latest changes locally in your repo.

Go to Pipelines and run the pipeline to make sure it is building and pushing to the ACR you created.

Now go to the master branch policy under Repos -> Branches and Add a build policy that triggers when master changes.

docker build -t pipelines-javascript-docker:latest . docker run -p 8080:8080 -d pipelines-javascript-docker:latest

References:

published: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment