Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pleroma
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pleroma
pleroma
Commits
c906ffc5
Verified
Commit
c906ffc5
authored
4 years ago
by
Haelwenn
Browse files
Options
Downloads
Patches
Plain Diff
mix.exs: Do not bail out when .git doesn’t exists
parent
d8142ee6
Branches
feature/groups
No related tags found
3 merge requests
!2927
Release/2.1.0
,
!2917
WIP: Pleroma 2.1 rc0
,
!2405
mix.exs: Do not bail out when .git doesn’t exists
Pipeline
#24647
passed
4 years ago
Stage: build
Stage: test
Stage: benchmark
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mix.exs
+20
-11
20 additions, 11 deletions
mix.exs
with
20 additions
and
11 deletions
mix.exs
+
20
−
11
View file @
c906ffc5
...
...
@@ -221,19 +221,26 @@ defp version(version) do
identifier_filter
=
~r/[^0-9a-z\-]+/i
# Pre-release version, denoted from patch version with a hyphen
{
tag
,
tag_err
}
=
System
.
cmd
(
"git"
,
[
"describe"
,
"--tags"
,
"--abbrev=0"
],
stderr_to_stdout:
true
)
{
describe
,
describe_err
}
=
System
.
cmd
(
"git"
,
[
"describe"
,
"--tags"
,
"--abbrev=8"
])
{
commit_hash
,
commit_hash_err
}
=
System
.
cmd
(
"git"
,
[
"rev-parse"
,
"--short"
,
"HEAD"
])
git_pre_release
=
with
{
tag
,
0
}
<-
System
.
cmd
(
"git"
,
[
"describe"
,
"--tags"
,
"--abbrev=0"
],
stderr_to_stdout:
true
),
{
describe
,
0
}
<-
System
.
cmd
(
"git"
,
[
"describe"
,
"--tags"
,
"--abbrev=8"
])
do
describe
|>
String
.
trim
()
|>
String
.
replace
(
String
.
trim
(
tag
),
""
)
|>
String
.
trim_leading
(
"-"
)
|>
String
.
trim
()
else
_
->
{
commit_hash
,
0
}
=
System
.
cmd
(
"git"
,
[
"rev-parse"
,
"--short"
,
"HEAD"
])
cond
do
tag_err
==
0
and
describe_err
==
0
->
describe
|>
String
.
trim
()
|>
String
.
replace
(
String
.
trim
(
tag
),
""
)
|>
String
.
trim_leading
(
"-"
)
|>
String
.
trim
()
commit_hash_err
==
0
->
"0-g"
<>
String
.
trim
(
commit_hash
)
true
->
""
end
# Branch name as pre-release version component, denoted with a dot
...
...
@@ -251,6 +258,8 @@ defp version(version) do
|>
String
.
replace
(
identifier_filter
,
"-"
)
branch_name
else
_
->
"stable"
end
build_name
=
...
...
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