Deploy to Azure from CircleCI

拈花ヽ惹草 提交于 2021-01-28 09:05:07

问题


I'm using CircleCI for the first time and having trouble publishing to Azure.

The docs don't have an example for Azure, they have an example for AWS and a note for Azure saying "To deploy to Azure, use a similar job to the above example that uses an appropriate command."

If anybody has an example YAML file that would be great, if not a nudge in the right direction would be handy. So far I think I've worked out the following.

  1. I need a config that will install the Azure CLI

  2. I need to put my Azure deployment credentials in an environment variable and

  3. I need to run a deploy command in the YAML file to zip up all the right files and deploy to my Azure app service.

I have no idea if the above is correct, or how to do it, but that's my understanding right now.

I've also posted this on the CircleCi forum.

EDIT: Just to add a little more info, the AWS version of the config file used the following command:

- run:
      name: Deploy to S3
      command: aws s3 sync jekyll/_site/docs s3://circle-production-static-site/docs/ --delete

So I guess I'm looking for the Azure equivalent.


回答1:


The easiest way is that on the azure management console you setup as deployment from source control and you can follow this two links

https://medium.com/@strid/automatic-deploy-to-azure-web-app-with-circle-ci-v2-0-1e4bda0626e5 https://www.bradleyportnoy.com/how-to-set-up-continuous-deployment-to-azure-from-circle-ci/

if you want to do the copy of the files from ci to the iis server or azure you will need ssh access the keys etc.. and In the Dependencies section of circle.yml you can have a line such as this:

deployment: production: branch: master commands: - scp -r circle-pushing/* username@my-server:/path-to-put-files-on-server/

“circle-pushing” is your repo name, which is whatever it’s called in GitHub or Bitbucket, and the rest is the hostname and filepath of the server you want to upload files to.

and probably this could help you understand it better https://docs.microsoft.com/en-us/azure/virtual-machines/linux/copy-files-to-linux-vm-using-scp



来源:https://stackoverflow.com/questions/51051140/deploy-to-azure-from-circleci

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!