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 [email protected]: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: