[英]Deploy GitLab web app to Azure app service
Hello guys am new with Gitlab and Azure , currently am having a repo on Gitlba and am trying to deploy it to Azure, but I can't manage to achieve this, tried to follow this link , but the information is old, Is there anyone with a latest link or resource to achieve this?大家好,我是 Gitlab 和 Azure 的新手,目前在 Gitlba 上有一个 repo 并正在尝试将其部署到 Azure,但我无法实现这一点,尝试按照此链接进行操作,但信息很旧,有没有人使用最新的链接或资源来实现这一目标?
Thanks谢谢
Joy 's answer above is helpful. Joy上面的回答很有帮助。 I've rewritten it to clarify the steps on obtaining a SSH 'deploy key'.
我已经重写它以阐明获取 SSH“部署密钥”的步骤。
Head over to your Gitlab repository and click the Clone button.转到您的 Gitlab 存储库并单击克隆按钮。 Copy the Clone with SSH address.
使用 SSH地址复制克隆。
Also, have your Gitlab account username and password available.另外,请准备好您的 Gitlab 帐户用户名和密码。
In the Azure portal go to your web app resource and go to the Deployment Center .在 Azure 门户中,转到您的 Web 应用资源并转到部署中心。 Choose the External option.
选择外部选项。 We're going to use the 'App Service build service'.
我们将使用“应用服务构建服务”。 Next enter in the data from step 1. Click Continue to finish.
接下来输入步骤 1 中的数据。单击继续完成。
Next we're going to get the SSH 'deploy key'.接下来,我们将获得 SSH 的“部署密钥”。
https://$mysite:BigRandomPassword@mysite.scm.azurewebsites.net/deploy
https://$mysite:BigRandomPassword@mysite.scm.azurewebsites.net/deploy
/deploy
with /api/sshkey?ensurePublicKey=1
./deploy
替换为/api/sshkey?ensurePublicKey=1
。 So it'll look like: https://$mysite:BigRandomPassword@mysite.scm.azurewebsites.net/api/sshkey?ensurePublicKey=1
https://$mysite:BigRandomPassword@mysite.scm.azurewebsites.net/api/sshkey?ensurePublicKey=1
ssh-rsa AAAAB3NzaC1etc...
In GitLab go to Settings -> Repository -> Deploy Keys and click Expand .在 GitLab 中,转到Settings -> Repository -> Deploy Keys并单击Expand 。 Add a title and the SSH 'deploy key' here.
在此处添加标题和 SSH“部署密钥”。 Then save.
然后保存。 Test it by going back to the Deployment Center in the Azure portal and clicking the Sync button.
通过返回到 Azure 门户中的部署中心并单击同步按钮来测试它。 It should work.
它应该工作。
Then we'll configure the continuous deployment.然后我们将配置持续部署。 In your GitLab go to Settings -> Integrations -> write the URL (This is the same Deployment Trigger URL in Properties we used earlier) To save click the Add webhook button.
在您的 GitLab 中,转到设置->集成-> 写入URL (这与我们之前使用的属性中的部署触发器 URL相同)要保存,请单击添加 webhook按钮。
Create a new file (or commit a change) in the GitLab project and it deploys to the web app automatically.在 GitLab 项目中创建一个新文件(或提交更改),它会自动部署到 Web 应用程序。
The UI of the azure portal and the GitLab have changed, but the steps are still similar. azure 门户和 GitLab 的 UI 发生了变化,但步骤仍然相似。
The link in the comment is helpful, I test it and works fine.评论中的链接很有帮助,我测试了一下,效果很好。 In order to prevent the link from failing in the future, I made some summary as below.
为了防止以后链接失效,我做了一些总结如下。
1.In the web app in the portal -> Deployment Center
-> External
-> App Service build service
-> write the information as below -> next to finish. 1.在门户网站的web应用->
Deployment Center
-> External
-> App Service build service
->写如下信息->下一步完成。
The Repository
you can get via the Clone
button in your GitLab project, the Username
and Password
is the ones of your GitLab account.您可以通过 GitLab 项目中的
Clone
按钮获取Repository
, Username
和Password
是您的 GitLab 帐户的Username
和Password
。
2.In your GitLab -> Settings
-> Repository
-> Deploy Keys
-> Expand
-> Add the key of the one in the https://<webapp-name>.scm.azurewebsites.net/api/sshkey?ensurePublicKey=1
( ssh-rsa xxxxxx
). 2.在你的GitLab ->
Settings
-> Repository
-> Deploy Keys
-> Expand
-> 添加https://<webapp-name>.scm.azurewebsites.net/api/sshkey?ensurePublicKey=1
( ssh-rsa xxxxxx
)。 Then you could test the Sync
in the Deployment Center
in the portal, it should work.然后您可以在门户中的
Deployment Center
测试Sync
,它应该可以工作。
3.Then we config the continuous deployment, in your GitLab -> Settings
-> Integrations
-> write the URL
( you can get it in the web app -> Properties
-> Deployment Trigger URL
) -> Add webhook
. 3.然后我们配置持续部署,在你的 GitLab ->
Settings
-> Integrations
-> 写URL
(你可以在 web app -> Properties
-> Deployment Trigger URL
) -> Add webhook
。
4.Then I create a new file in the GitLab project, it deploys to the web app automatically. 4.然后我在 GitLab 项目中创建一个新文件,它会自动部署到 Web 应用程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.