UNCLASSIFIED - NO CUI
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bigbang
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Big Bang
bigbang
Commits
3d80c360
Commit
3d80c360
authored
4 years ago
by
Zachariah Dzielinski
Browse files
Options
Downloads
Patches
Plain Diff
Added basegitrepository.yaml tag check
parent
89ec6a6a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!158
Linting for changelog and version
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+1
-0
1 addition, 0 deletions
.gitlab-ci.yml
scripts/lint_version.sh
+42
-10
42 additions, 10 deletions
scripts/lint_version.sh
with
43 additions
and
10 deletions
.gitlab-ci.yml
+
1
−
0
View file @
3d80c360
...
...
@@ -53,6 +53,7 @@ version:
allow_failure
:
true
variables
:
CHART_FILE
:
chart/Chart.yaml
BASEGIT_FILE
:
base/gitrepository.yaml
script
:
-
git fetch --all
-
./scripts/lint_version.sh
...
...
This diff is collapsed.
Click to expand it.
scripts/lint_version.sh
+
42
−
10
View file @
3d80c360
#!/usr/bin/env bash
# obtain the default version
default_version
=
$(
git show origin/
${
CI_DEFAULT_BRANCH
}
:
${
CHART_FILE
}
|
grep
-oP
'version: \K(.*)'
)
# obtain the default
chart
version
chart_
default_version
=
$(
git show origin/
${
CI_DEFAULT_BRANCH
}
:
${
CHART_FILE
}
|
g
grep
-oP
'version: \K(.*)'
)
# check for command error
if
[
$?
-ne
0
]
;
then
...
...
@@ -9,8 +9,8 @@ if [ $? -ne 0 ]; then
exit
1
fi
# obtain the local version
local_version
=
$(
cat
${
CHART_FILE
}
|
grep
-oP
'version: \K(.*)'
)
# obtain the local
chart
version
chart_
local_version
=
$(
cat
${
CHART_FILE
}
|
g
grep
-oP
'version: \K(.*)'
)
# check for command error
if
[
$?
-ne
0
]
;
then
...
...
@@ -18,15 +18,47 @@ if [ $? -ne 0 ]; then
exit
1
fi
# obtain the default base git repository tag
basegit_default_tag
=
$(
git show origin/
${
CI_DEFAULT_BRANCH
}
:
${
BASEGIT_FILE
}
| ggrep
-oP
'tag: \K(.*)'
)
# check for command error
if
[
$?
-ne
0
]
;
then
echo
"Error: An unknown error has occurred while attempting to retrieve the default tag from
${
BASEGIT_FILE
}
"
exit
1
fi
# obtain the local base git repository tag
basegit_local_tag
=
$(
cat
${
BASEGIT_FILE
}
| ggrep
-oP
'tag: \K(.*)'
)
# check for command error
if
[
$?
-ne
0
]
;
then
echo
"Error: An unknown error has occurred while attempting to retrieve the local tag from
${
BASEGIT_FILE
}
"
exit
1
fi
# debug print
echo
"Default version:
$default_version
"
echo
"Local version:
$local_version
"
echo
"Default chart version:
$chart_default_version
"
echo
"Local chart version:
$chart_local_version
"
# assume success
exit_code
=
0
# error if the versions are not different
if
[[
"
$default_version
"
==
"
$local_version
"
]]
;
then
if
[[
"
$
chart_
default_version
"
==
"
$
chart_
local_version
"
]]
;
then
echo
"The version has not been updated in
${
CHART_FILE
}
, please update this file"
exit
1
exit_code
=
1
fi
echo
"--"
echo
"Default base git repository version:
$basegit_default_tag
"
echo
"Local base git repository version:
$basegit_local_tag
"
# error if the versions are not different
if
[[
"
$chart_default_version
"
==
"
$chart_local_version
"
]]
;
then
echo
"The tag has not been updated in
${
CHART_FILE
}
, please update this file"
exit_code
=
1
fi
# default to success
exit
0
\ No newline at end of file
# exit with stored code
exit
$exit_code
\ No newline at end of file
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