Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: gitlab-ce-docker options style fixed & gitops image locations reorganization #1068

Merged
merged 3 commits into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions docs/best-practices/gitops.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,51 +109,51 @@ Let's continue to look at the results of the `apply` command.

- The repository scaffolding we got looks like this:

![](a.png)
![](gitops/a.png)

### 5.2 Jira-Github Integration

- How do Jira and Github integrate? Let's create a new issue:

![](b.png)
![](gitops/b.png)

- The issue will be renamed automatically like this:

![](c.png)
![](gitops/c.png)

- We can find this auto-synced `Story` in Jira:

![](d.png)
![](gitops/d.png)

- If we continue to leave a comment on this issue:

![](d1.png)
![](gitops/d1.png)

- The comment will also be automatically synced to Jira:

![](e.png)
![](gitops/e.png)

### 5.3 GitHub Actions CI for Golang

- What does CI do here?

![](f.png)
![](gitops/f.png)

- The CI processes also build an image, and this image is automatically pushed to DockerHub:

![](g.png)
![](gitops/g.png)

### 5.4 ArgoCD Deployment

- Of course, the ArgoCD must have been installed as expected.

![](h.png)
![](gitops/h.png)

### 5.5 ArgoCD Application Deployment

- Our code has just been built into an image, at this time the image is automatically deployed to our k8s as a Pod:

![](i.png)
![](gitops/i.png)

## 6 Clean Up

Expand Down
20 changes: 10 additions & 10 deletions docs/best-practices/gitops.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,51 +101,51 @@ dtm apply -f gitops.yaml

- 我们得到的仓库结构看起来如下:

![](a.png)
![](gitops/a.png)

### 5.2 Jira-Github 集成

- 测试Jira和Github之间的整合,让我们新创建一个issue:

![](b.png)
![](gitops/b.png)

- 上述issue将会自动地被重命名:

![](c.png)
![](gitops/c.png)

- 我们可以在Jira中找到这个自动同步的`Story`:

![](d.png)
![](gitops/d.png)

- 如果我们在这个issue留下评论:

![](d1.png)
![](gitops/d1.png)

- 这个评论也会被自动同步到Jira中:

![](e.png)
![](gitops/e.png)

### 5.3 为Golang设置Github Actions CI

- CI在这里可以做以下事情:

![](f.png)
![](gitops/f.png)

- CI流程同时也会构建Docker镜像,之后该镜像会被自动推送到DockerHub中:

![](g.png)
![](gitops/g.png)

### 5.4 ArgoCD部署

- ArgoCD已经被装好了:

![](h.png)
![](gitops/h.png)

### 5.5 ArgoCD应用部署

- 我们的代码刚刚被构建到镜像中,此时这个镜像会作为一个Pod自动部署到我们的k8s中:

![](i.png)
![](gitops/i.png)

## 6 清理

Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
12 changes: 6 additions & 6 deletions internal/pkg/plugin/gitlabcedocker/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import (
type Options struct {
Hostname string `validate:"hostname" mapstructure:"hostname"`
// GitLab home directory, we assume the path set by user is always correct.
GitLabHome string `mapstructure:"gitlab_home"`
SSHPort uint `mapstructure:"ssh_port"`
HTTPPort uint `mapstructure:"http_port"`
HTTPSPort uint `mapstructure:"https_port"`
RmDataAfterDelete *bool `mapstructure:"rm_data_after_delete"`
ImageTag string `mapstructure:"image_tag"`
GitLabHome string `mapstructure:"gitlabHome"`
SSHPort uint `mapstructure:"sshPort"`
HTTPPort uint `mapstructure:"httpPort"`
HTTPSPort uint `mapstructure:"httpsPort"`
RmDataAfterDelete *bool `mapstructure:"rmDataAfterDelete"`
ImageTag string `mapstructure:"imageTag"`
}

func (opts *Options) Defaults() {
Expand Down
14 changes: 7 additions & 7 deletions internal/pkg/show/config/plugins/gitlab-ce-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ tools:
# (default: /srv/gitlab)
# 1. it should be a absolute path
# 2. once the tool is installed, it can't be changed
gitlab_home: /srv/gitlab
gitlabHome: /srv/gitlab
# ssh port exposed in the host machine. (default: 22)
ssh_port: 22
sshPort: 22
# http port exposed in the host machine. (default: 80)
http_port: 80
httpPort: 80
# https port exposed in the host machine.
# (default: 443)
# todo: support https, reference: https://docs.gitlab.com/omnibus/settings/nginx.html#enable-https
https_port: 443
# whether to delete the gitlab_home directory when the tool is removed. (default: false)
rm_data_after_delete: false
httpsPort: 443
# whether to delete the gitlabHome directory when the tool is removed. (default: false)
rmDataAfterDelete: false
# gitlab-ce tag. (default: "rc")
image_tag: "rc"
imageTag: "rc"
10 changes: 5 additions & 5 deletions test/state/test_drifted.state
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ gitlab-ce-docker_default:
options:
gitlab_home: /srv/gitlab
hostname: gitlab.example.com
http_port: 8080
https_port: 443
image_tag: rc
rm_data_after_delete: false
ssh_port: 2022
httpPort: 8080
httpsPort: 443
imageTag: rc
rmDataAfterDelete: false
sshPort: 2022
resource:
ContainerRunning: true
Hostname: gitlab.example.com
Expand Down