从CircleCI部署到Azure [英] Deploy to Azure from CircleCI

查看:87
本文介绍了从CircleCI部署到Azure的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是第一次使用CircleCI,但无法发布到Azure.

该文档没有Azure的示例,但有AWS的示例,还有Azure的注释,上面写着要部署到Azure,请使用与上面使用适当命令的示例相似的作业."

如果有人有一个很好的示例YAML文件,那么如果不按正确的方向进行操作将很方便.到目前为止,我认为我已经解决了以下问题.

  1. 我需要一个将安装Azure CLI的配置

  2. 我需要将我的Azure部署凭据放在环境变量中,并且

  3. 我需要在YAML文件中运行deploy命令,以压缩所有正确的文件并部署到我的Azure应用服务.

我不知道上面的方法是否正确,或者如何做,但这是我目前的理解.

我还将其发布在 CircleCi论坛.

仅添加一些信息,AWS版本的配置文件使用以下命令:

 -运行:名称:部署到S3命令:aws s3 sync jekyll/_site/docs s3://circle-production-static-site/docs/--delete 

所以我想我正在寻找Azure等效产品.

解决方案

最简单的方法是,在azure管理控制台上,您可以从源代码管理中将其设置为部署,并且可以点击这两个链接

https://medium.com/@strid/automatic-deploy-to-azure-web-app-with-circle-ci-v2-0-1e4bda0626e5 https://www.bradleyportnoy.com/如何从Circle-ci/

如果要将文件从ci复制到iis服务器或azure,则需要ssh访问密钥等.并且在circle.yml的Dependencies部分中,您可以有这样的一行:/p>

<代码>部署:生产:分支机构:硕士命令:-scp -r circle-pushing/* username @ my-server:/path-to-put-files-on-server/

推圆"是您的存储库名称,即在GitHub或Bitbucket中的名称,其余是您要将文件上传到的服务器的主机名和文件路径.

这也许可以帮助您更好地理解它 https://docs.microsoft.com/zh-CN/azure/virtual-machines/linux/copy-files-to-linux-vm-using-scp

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.

解决方案

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

这篇关于从CircleCI部署到Azure的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆