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

🍀 Proposal: Expose image_tag config in gitlab-ce-docker plugin #734

Closed
aFlyBird0 opened this issue Jun 22, 2022 · 5 comments
Closed

🍀 Proposal: Expose image_tag config in gitlab-ce-docker plugin #734

aFlyBird0 opened this issue Jun 22, 2022 · 5 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@aFlyBird0
Copy link
Member

aFlyBird0 commented Jun 22, 2022

What Would You Like to Add? Why Is This Needed?

We added a new plugin gitlab-ce-docker a few days ago to install gitlab-ce in docker.

However, the image tag is hardcoded now.

const (
gitlabImageName = "gitlab/gitlab-ce"
// TODO expose image tag to user in config file to customize
gitlabImageTag = "rc"
tcp = "tcp"
)
var (
gitlabImageNameWithTag = fmt.Sprintf("%v:%v", gitlabImageName, gitlabImageTag)
gitlabContainerName = "gitlab"
)

As you can see, the image name is a const, and only support rc now.

We want to expose this var to the config file to make the user customize it.

Design && Guides

Note: This good first issue looks like a little bit difficult. But trust me, it is easy in fact and I will give you as much guidance as I can.

1. Here is the config file, just put new config image_tag here.

options:
# hostname for running docker
hostname: gitlab.devstream.io
# the directory where you store docker volumes of gitlab
# 1. it should be a absolute path
# 2. once the tool is applied, it can't be changed
gitlab_home: /srv/gitlab
# ssh port exposed in the host machine
ssh_port: 22
# http port exposed in the host machine
http_port: 80
# https port exposed in the host machine
# 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
rm_data_after_delete: false

2. Modify the Options structure, which corresponds to the configuration file of the first step

package gitlabcedocker
// Options is the struct for configurations of the gitlab-ce-docker plugin.
type Options struct {
// GitLab home directory, we assume the path set by user is always correct.
GitLabHome string `validate:"required" mapstructure:"gitlab_home"`
Hostname string `validate:"required,hostname" mapstructure:"hostname"`
SSHPort uint `validate:"required" mapstructure:"ssh_port"`
HTTPPort uint `validate:"required" mapstructure:"http_port"`
HTTPSPort uint `validate:"required" mapstructure:"https_port"`
RmDataAfterDelete bool `mapstructure:"rm_data_after_delete"`
}

3. change the generate logic of gitlabImageNameWithTag

Now it is generate by two const: gitlabImageName and gitlabImageTag.

We should generate it by gitlabImageName and the image tag from options.

Anything else

Please feel free to ask any questions.

@aFlyBird0 aFlyBird0 added the good first issue Good for newcomers label Jun 22, 2022
@wendao365
Copy link
Contributor

let me?

@wendao365
Copy link
Contributor

The level is still relatively low, but I want to try my best

@aFlyBird0
Copy link
Member Author

let me?

Sorry, you are very active. Thank you sincerely. But this is "good first issue" meaning only new contributors can be assigned. And you have submitted a pr in #739 . You are our "old friends" now.

(By the way, if this issue has not been claimed for a long time, I may transform it into "help wanted". Then you could try this.)

Do you have any other issues you want to work on? Or, just look through our source code, find something that doesn't make sense or can be improved, and feel free to submit issues and pr! @wendao365

@amdaous
Copy link
Contributor

amdaous commented Jun 24, 2022

let me?

@aFlyBird0 aFlyBird0 assigned amdaous and aFlyBird0 and unassigned amdaous and aFlyBird0 Jun 24, 2022
@aFlyBird0
Copy link
Member Author

let me?

Enjoy your coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants