Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
G
go-semrel-gitlab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
3
Snippets
Groups
Projects
Show more breadcrumbs
Juhani Ränkimies
go-semrel-gitlab
Commits
ebeceb4b
Commit
ebeceb4b
authored
6 years ago
by
Juhani Ränkimies
Browse files
Options
Downloads
Patches
Plain Diff
feat: configuration option for tag-prefix (#61)
parent
cb3b060c
No related branches found
No related tags found
No related merge requests found
Pipeline
#30976088
passed
6 years ago
Stage: version
Stage: build
Stage: image
Stage: release
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.go
+11
-3
11 additions, 3 deletions
main.go
with
11 additions
and
3 deletions
main.go
+
11
−
3
View file @
ebeceb4b
...
@@ -258,6 +258,7 @@ func addDownloadLink(c *cli.Context) error {
...
@@ -258,6 +258,7 @@ func addDownloadLink(c *cli.Context) error {
// release commit-and-tag
// release commit-and-tag
// release tag-and-commit
// release tag-and-commit
func
commitAndTagBase
(
c
*
cli
.
Context
,
reversed
bool
)
error
{
func
commitAndTagBase
(
c
*
cli
.
Context
,
reversed
bool
)
error
{
tagPrefix
:=
strings
.
TrimSpace
(
c
.
GlobalString
(
"tag-prefix"
))
branch
:=
c
.
GlobalString
(
"ci-commit-ref-name"
)
branch
:=
c
.
GlobalString
(
"ci-commit-ref-name"
)
project
:=
c
.
GlobalString
(
"ci-project-path"
)
project
:=
c
.
GlobalString
(
"ci-project-path"
)
refFunc
:=
actions
.
FuncOfString
(
c
.
GlobalString
(
"ci-commit-sha"
))
refFunc
:=
actions
.
FuncOfString
(
c
.
GlobalString
(
"ci-commit-sha"
))
...
@@ -284,8 +285,8 @@ func commitAndTagBase(c *cli.Context, reversed bool) error {
...
@@ -284,8 +285,8 @@ func commitAndTagBase(c *cli.Context, reversed bool) error {
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
tagID
:=
"v"
+
info
.
NextVersion
.
String
()
tagID
:=
tagPrefix
+
info
.
NextVersion
.
String
()
message
:=
fmt
.
Sprintf
(
"chore: version bump for
v
%s [skip ci]"
,
info
.
NextVersion
.
String
()
)
message
:=
fmt
.
Sprintf
(
"chore: version bump for %s [skip ci]"
,
tagPrefix
)
client
,
err
:=
clientFromContext
(
c
)
client
,
err
:=
clientFromContext
(
c
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -307,6 +308,7 @@ func commitAndTagBase(c *cli.Context, reversed bool) error {
...
@@ -307,6 +308,7 @@ func commitAndTagBase(c *cli.Context, reversed bool) error {
// release tag
// release tag
func
tag
(
c
*
cli
.
Context
)
error
{
func
tag
(
c
*
cli
.
Context
)
error
{
tagPrefix
:=
strings
.
TrimSpace
(
c
.
GlobalString
(
"tag-prefix"
))
project
:=
c
.
GlobalString
(
"ci-project-path"
)
project
:=
c
.
GlobalString
(
"ci-project-path"
)
sha
:=
c
.
GlobalString
(
"ci-commit-sha"
)
sha
:=
c
.
GlobalString
(
"ci-commit-sha"
)
client
,
err
:=
clientFromContext
(
c
)
client
,
err
:=
clientFromContext
(
c
)
...
@@ -339,7 +341,7 @@ func tag(c *cli.Context) error {
...
@@ -339,7 +341,7 @@ func tag(c *cli.Context) error {
client
,
client
,
project
,
project
,
actions
.
FuncOfString
(
sha
),
actions
.
FuncOfString
(
sha
),
"v"
+
info
.
NextVersion
.
String
(),
tagPrefix
+
info
.
NextVersion
.
String
(),
releaseNote
)
releaseNote
)
return
workflow
.
Apply
([]
workflow
.
Action
{
createTag
})
return
workflow
.
Apply
([]
workflow
.
Action
{
createTag
})
...
@@ -517,6 +519,12 @@ func main() {
...
@@ -517,6 +519,12 @@ func main() {
produce normal releases. WARNING: this is an experimental feature.`
,
produce normal releases. WARNING: this is an experimental feature.`
,
EnvVar
:
"GSG_RELEASE_BRANCHES"
,
EnvVar
:
"GSG_RELEASE_BRANCHES"
,
},
},
cli
.
StringFlag
{
Name
:
"tag-prefix"
,
Value
:
"v"
,
Usage
:
"`Prefix` to use in version tags."
,
EnvVar
:
"GSG_TAG_PREFIX"
,
},
cli
.
StringFlag
{
cli
.
StringFlag
{
Name
:
"pre-tmpl"
,
Name
:
"pre-tmpl"
,
Usage
:
`Pre-release version template. Comma separated list of ID templates.`
,
Usage
:
`Pre-release version template. Comma separated list of ID templates.`
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment