VSTS Deploy to Azure WebApp For Linux - azure-devops

Is it possible to deploy an application from VSTS to a WebApp on Linux.
My Webapp is a simple ruby app and I'm currently deploying it with the hosted git repo like in the doc: https://learn.microsoft.com/en-us/azure/app-service/containers/quickstart-ruby
git remote add azure <Git deployment URL from above>
git add -A
git commit -m "Initial deployment commit"
git push azure master
Is there a way to do it using a repo in VSTS?

First, the Azure App Service Deployment task supports Web App on Linux app service type, so you can deploy your ruby app through this task, for example:
Create a new build definition
Specify the source with corresponding repository and branch
Add Archive files task to put necessary files to zip file
Add Azure App Service Deploy task (App type: Linux Web App; Image Source: Built-in Image; Package or folder: [zip file in step 3]; Runtime Stack: Ruby 2.3)
Note: You can deploy it through Release.
Secondly, if Deployment option is available, you can configure it in azure portal: Continuous Deployment to Azure App Service.
On the other hand, you also can push source to server through git command as you are using:
Add Command Line task: (Tool: git; Arguments: remove add azure [git deployment URL]; Working folder: $(build.SourcesDirectory)). Note: the git deployment URL should contains username and password, for example: https://[username]:[password]#[app name].scm.azurewebsites.net/[app name].git (username can’t contains # character)
The same as other git command

Related

Salesforce DevOps with Github, sfdx & Jenkins

I need to implement a salesforce DevOps solution using Jenkins as deployment tool, Github as version control and SFDX as cli to be used as in deployment build steps.
Can anyone list out the step by step procedure once the tool(GitHub, Jenkins, salesforce, SFDX) are ready. I understood to include SFDX script or commands in build steps in Jenkins but have few queries too:
How can I deploy the entire release branch using Jenkins to target org.
How can I deploy specific components based on package.xml to target org.
Also, anyone has SFDX script to be used as reference.
I have setup salesforce, Jenkins, GitHub & SFDX tool on windows currently.
Tried deploying a set of components to target org but was not sure whether we have to create a SFDX project separately that will be committed to GitHub and will have to convert the code to metadata item.
Expectation would be to deploy salesforce components from GitHub release branch to salesforce target or using Jenkins pipeline or job.

Azure DevOps deploy Angular app to IIS with Octopus

I'm trying to deploy a Angular application to my IIS server using Octopus and Azure DevOps
My application has multiple environments, each environment with it's own settings (config.prod.json)
What I want to do
Basically Octopus should take the release from Azure DevOps, and copy the release to multiple folders, with different config.prod.json files.
Each folder corresponds to a specific IIS website.
Azure DevOps pipeline setup
Use Node 14.x
npm install
ng build --prod
Archive dis/angular-app ; Archive type: zip
Publish Artifact; Path $(Build.ArtifactStagingDirectory)
Triggers : Enable continuous integration
Azure DevOps Releases setup
1. Package Application for Octopus
2. Push Package(s) to Octopus
3. Create Octopus Release
Octopus setup
One step DEPLOY TO IIS
1. Package details
2. Custom Installation Directory
[![enter image description here][5]][5]
3. IIS Web Site and Application Pool
Errors
In IIS while I click Binding, Basic settings, I get this error: There was an error while performing this operation. The parameter is incorrect
Also, the folder mapped in iis for the website that I'm targeting. Contains a folder drop with the zip file 27.zip (27 is the release id)
How do I unzip the zip file?
How do I replicate the zip file to the other environments?
Is my configuration ok so far? What am I doing wrong?
Just a few of the links that I've checked:
https://octopus.com/docs/guides/deploy-aspnetcore-app/to-iis/using-octopus-onprem-azure-devops-builtin
https://www.youtube.com/watch?v=NFqrWsUPCAM&t=345s
https://www.youtube.com/watch?v=oeNYtYuhZQ4&t=2s

Publish a build artifect to a remote Git Repo - Azure DevOps

I have a build pipeline and I would like to publish the build artifect to a remote location which is a folder in an external Git repo. I have been able to create a "Azure Repos/Team Foundation" Server service connection to point to the external Azure DevOps. how do I consume that service connection through my build pipeline tasks? I could also use a release pipeline and copy the package over to a remote Git repo as well. How can I achieve this ?
I found the solution for this by using this extension - you can use it to point to a
TFVC repo
Git repo
Build pipeline
Release pipeline
TFS Artifects for Release Management

How to download files from self hosted VM to VSTS

I have python solution which resides in VSTS repository. Using build pipeline and private agent, the source code gets copied to VM.
After executing the python files, output is stored in 3 different files at the source directory level.
I want to download/copy these output files from private hosted VM to VSTS repository.
How can this be achieved?
Thank you
The only way to get something into the repository is by checking it in via source control.
Maybe it's enough for you to just publish these files as a build artifact. You have the option to publish directly to VSTS or to any Windows file share.
If you really want these files in your repository I'd suggest you publish them as build artifacts and check them in with a release pipeline. You could add a new stage in your existing release pipeline or add a new release pipeline that triggers automatically every time your build completes.
You can call git command to add and push changes to repository, for example:
Check Allow Scripts to access the OAuth token option
Add Command Line task (Tool:git; Arguments: add [file path]; Working folder: $(System.DefaultWorkingDirectory))
Add command line task (Tool:git; Arguments: commit –m “add build result”; Working folder: $(System.DefaultWorkingDirectory))
Add command line task (Tool: git; Arguments: push https://test:$(System.AccessToken)#{account}.visualstudio.com/{project}/_git/{repository} HEAD:master
Related article: Keep Git repository in sync between VSTS / TFS and Git
On the other hand, the better way is publishing the result files as artifact of build through Publish Build Artifact task.

How to configure a Thoughtworks:GO task to deploy a repo?

I'm trying to figure out how to create a task (custom-command, not ant/rake, etc) to perform a deployment of a git-repo to some server/target (in this case Heroku). If I were to do this manually, it's just git push heroku master.
I've created a basic pipeline/stage/job/task (custom-command, in this case a Python script), and single agent. The pipeline has a material (git repo, with a name). Inside the script, I'm printing out os.environ.items() - it has several variables, including the SHA of the latest commit - but no URL for the actual repository.
So how is the agent (or task) supposed to know what repository to deploy?
The pipeline knows the material name, and I've tried passing in an Environment Variable such as ${materialName} (which didn't work). I could hard-code a URL in the task, but that's not a real solution.
Thoughtworks:GO's documentation is shiny, but a bit sparse in the details. I'd have thought something this basic would be well documented, but if so, I haven't found it so far.
When a task runs on an agent, it clones the repository specified in the material (config). The .git/config wouldn't have remote Heroku url and as such git push heroku master wouldn't work.
You would need to add Heroku remote url before you can perform a deployment of your git-repo to Heroku.
git remote add heroku git#heroku.com:project.git
where project is the name of your Heroku project. This is required to be done only once unless you perform a clean working directory every time (in Stage Settings which removes all files/directories in the working directory on the agent, you can see this option from the UI as well: Admin -> Piplelines -> Stages -> Stage Settings Tab) in which case you may have to add the remote url via a task before you run the task to deploy.
Once you've done so, you should be able to use the heroku xxxx commands (assuming you have the Heroku Toolbelt installed on the agent machine you are using for deploying), and should be able to push to Heroku as usual via git push heroku master.