什么是gitlab“环境”与软件运行环境相比?

发布于 2025-01-23 04:28:28 字数 1040 浏览 3 评论 0原文

根据其文档,GitLab环境由名称组成,并由URL组成。在我的软件职业中,“环境”有一个名称,例如“生产”,但由操作系统,安装依赖项,位置,磁盘容量,数据库连接等组成。

我已经研究了 gitlab docs stackoverflow问题 stackoverflow问题 我看到的最接近的是,您可能有一个指向您的代码运行的URL。 Gitlab如何使用可选的URL知道如何仅给定源和名称“ staging”安装我的软件?我正在尝试在托管的GitLab实例的大学中使用网络上的服务器进行连续集成和部署。谁能告诉我我缺少什么概念?

编辑:
示例:我已经在云中构建并安装了一个托管基于Web的调查的生产应用程序。它具有功能代码来提出问题和流程答案,该问题连接到存储调查本身配置的数据库。我已经建立了一个调查管理桌面应用程序,该应用程序允许以本地文件格式创建和编辑调查内容。该应用程序包括一个“部署”按钮,该按钮连接到生产数据库并插入/更新调查细节。我必须在某个时候输入连接字符串,以便我的部署知道要部署的位置,并且我必须对SQL命令和其他逻辑进行编程以进行此类部署。较少频率,我更新Web调查应用程序的功能代码。这是一个不同的过程,在该过程中,我远程连接到服务器VM,然后手动将文件放在其位置。

我的问题是关于Gitlab,而不是第三方替代方案和附加组件。

GitLab的环境和部署(或其他DevOps)是否与此类常见情况有关?
如果是这样,我在GitLab中在哪里指定有关如何访问环境和执行部署的无数详细信息(或开球脚本)?
胶在哪里?

GitLab Environments consist of a name and optionally a URL, according to its docs. In my software career an "environment" HAS a name, like "production", but CONSISTS of things like operating system, installed dependencies, location, disk capacity, database connections, etc.

I have looked at GitLab docs and
StackOverflow question and
StackOverflow question
and the closest I see is that you might have a URL that points to where your code will run. How does GitLab know how to install my software given only source and the name "staging", with an optional URL? I'm trying to get into continuous integration and deployment, using servers on my network, at a university with its hosted GitLab instance. Can anyone tell me what concepts I am missing?

EDIT:
Example: I have built and installed in the cloud a production application that hosts web-based surveys. It has functional code to present questions and process answers, which connects to a database that stores the configuration of the surveys themselves. I have built a survey management desktop app that allows creation and editing of survey content in a local file format. This app includes a "Deploy" button which connects to the production database and inserts/updates the survey specifics. I had to type in the connection string at some point, for my deployer to know where to deploy, and I had to program the SQL commands and other logic to carry out such a deployment. Less frequently, I update the functional code of the web survey app. That is a different process, in which I connect to the server vm remotely, and manually put the files where they go.

My question is about GitLab, not 3rd party alternatives and add-ons.

Do GitLab's Environments and Deployments (or other DevOps) features pertain to common situations like this?
If so, where in GitLab do I specify the myriad details (or kickoff script) about how to access the environment and execute deployments?
Where is the glue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

芯好空 2025-01-30 04:28:28

在GitLab中,环境是纯粹的逻辑结构。您可以将CI/CD作业指定为各种环境的部署作业。当您从Gitlab UI中“停止”环境时,您还可以指定要触发的作业,但是您需要实现详细信息。 GitLab还提供了“回滚”功能,这实际上只是意味着重新运行较旧的部署作业。

Gitlab存储一些信息并提供了一些胶水,但是它与您实际管理环境内容的方式完全不同,这些环境的内容必须在工作和其他地方实施。

也就是说:Gitlab 不知道在哪里安装软件。您必须实施。 Gitlab的AutodeVops确实提供了一些轻松实施部署的方法,尤其是对于GitLab管理的Kubernetes群集,但最终您可以控制工作的工作以及如何运行环境。您可能会做使用Ansible Playbooks从Gitlab CI 进行管理基础架构

,以进行进一步阅读,请查看Gitlab的博客:如何使用gitlab ci部署到多个环境

In GitLab, the Environment is a purely logical construct. You can designate CI/CD jobs as deployment jobs to various environments. You can also designate jobs to be triggered when you "stop" an environment from the GitLab UI, but you need to implement the details. GitLab also provides a "rollback" feature, which really just means to re-run an older deployment job.

GitLab stores some information and provides a little glue, but it is entirely separate from how you actually manage the contents of your environment, which you must implement in your jobs and elsewhere.

That is to say: GitLab doesn't know where to install your software. You have to implement that. GitLab's autodevops does provide some ways to easily implement deployments, especially for gitlab-managed Kubernetes clusters, but ultimately you control what your jobs do and how your environment is run. You might do something like use ansible playbooks to manage infrastructure from GitLab CI

For further reading, check out GitLab's blog: How to use GitLab CI to deploy to multiple environments.

虽然“它与您实际管理环境的内容完全分开”,但 sytech 在他的答案中, gitlab 17.6 (2024年11月)确实提出了:

在部署详细信息上显示发行说明页

您是否曾经想过要批准的部署中可能包括什么?
在过去的版本中,您可以创建一个版本,其中包含有关其内容和测试的说明的详细说明,但是相关环境特定的部署未显示此数据。

我们很高兴分享Gitlab现在在“相关部署详细信息”页面下显示发行说明。

由于GitLab版本始终是通过Git标签创建的,因此仅在与标签触发的管道有关的部署上显示发行说明。

此功能由 anton kalmykov 。谢谢!

请参阅 href =“ https://gitlab.com/gitlab-org/gitlab/-/issues/493260” rel =“ nofollow noreferrer”> essugy

和:

请参阅 gitlab 17.8 (2025年1月)

列出与版本有关的部署

GitLab长期以来一直支持从Git标签创建发行版和跟踪部署,但此信息以前生活在难以拼凑在一起的多个单独的位置。现在,您可以直接在发布页面上看到与发布有关的所有部署。发布经理可以快速验证发布发布的位置以及哪些环境正在待部署。这补充了现有的部署页面集成,该页面显示了标记部署的发行说明。

我们要表示感谢 anton kalmykov 为Gitlab贡献了这两个功能。

“

请参阅 documentation esjuction


因此,如果您有部署批准流程,则环境的“部署详细信息”页面现在浮出实际发行说明。不再猜测什么正在发生变化。

您可以在GitLab中打开“发布”页面,并查看所有部署。您还可以将特定的更改,提交或说明链接到环境部署。 FF您有多个人审查或手动批准最终的生产推动力,这应该有所帮助。

While "it is entirely separate from how you actually manage the contents of your environment", as sytech in his answer, GitLab 17.6 (November 2024) does propose:

Display release notes on deployment details page

Have you ever wondered what might be included in a deployment you’ve been asked to approve?
In past versions, you could create a release with a detailed description about its content and instructions for testing, but the related environment-specific deployment did not show this data.

We are happy to share that GitLab now displays the release notes under the related deployment details page.

Because GitLab releases are always created from a Git tag, the release notes are shown only on deployments related to the tag-triggered pipeline.

This feature was contributed to GitLab by Anton Kalmykov. Thank you!

https://about.gitlab.com/images/17_6/deploy-automatically-show-release-notes.png -- Display release notes on deployment details page

See Documentation and Issue.

And:

See GitLab 17.8 (January 2025)

List the deployments related to a release

While GitLab has long supported creating releases from Git tags and tracking deployments, this information previously lived in multiple separate places that were difficult to piece together. Now, you can see all deployments related to a release directly on the release page. Release managers can quickly verify where a release has been deployed and which environments are pending deployment. This complements the existing deployment page integration that shows release notes for tagged deployments.

We would like to express our gratitude to Anton Kalmykov for contributing both features to GitLab.

https://about.gitlab.com/images/17_8/list_the_deployments_related_to_a_release.png -- List the deployments related to a release

See Documentation and Issue.


So if you have a deployment approval process, the environment's "deployment details" page now surfaces the actual release notes. No more guesswork about what is changing.

You can open the "release" page in GitLab and see all deployments. You can also link specific changes, commits, or instructions to the environment deployment. Ff you have multiple people reviewing or manually approving a final production push, that should help.

囍笑 2025-01-30 04:28:28

马洛利。胶称为“ .gitlab-ci.yml”。解释被埋葬在这里:
https://docs.gitlab.com/eee/ee/ee/ee/ci/ci/yaml/yaml/gitlab_ci_yamaml,c.gitlab.com/eeme =“ html
“要使用gitlab ci/cd,您需要:
应用程序代码托管在Git存储库中。
文件,其中包含CI/CD配置。

一个名为.gitlab-ci.yml的 文档说您可以使用UI或.gitlab-ci.yml文件来定义环境和部署。您必须在其他地方搜索所有非常重要的.yml文件的语法和选项。

Holy maloley. The glue is called ".gitlab-ci.yml". Explanation is buried here:
https://docs.gitlab.com/ee/ci/yaml/gitlab_ci_yaml.html
"To use GitLab CI/CD, you need:
Application code hosted in a Git repository.
A file called .gitlab-ci.yml in the root of your repository, which contains the CI/CD configuration."

I don't know why this vital foundation isn't positioned more prominently in the docs. Documentation says you can use the UI, or the .gitlab-ci.yml file to define environments and deployments. I mistakenly assumed that meant some kind of equivalence, rather than that the UI provides only the ability to define a stub, and that you have to search elsewhere for the syntax and options for the all-important .yml file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文