Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
456962b2
Commit
456962b2
authored
Mar 06, 2020
by
Erik Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update versioning for no .git or go
parent
34109863
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
version.sh
scripts/version.sh
+17
-12
No files found.
scripts/version.sh
View file @
456962b2
#!/bin/bash
ARCH
=
${
ARCH
:-$(
go
env
GOARCH
)}
SUFFIX
=
"-
${
ARCH
}
"
GIT_TAG
=
$DRONE_TAG
TREE_STATE
=
clean
if
[
-n
"
$(
git status
--porcelain
--untracked-files
=
no
)
"
]
;
then
DIRTY
=
"-dirty"
TREE_STATE
=
dirty
fi
COMMIT
=
unknown
COMMIT
=
$(
git log
-n3
--pretty
=
format:
"%H %ae"
|
grep
-v
' drone@localhost$'
|
cut
-f1
-d
\
|
head
-1
)
if
[
-z
"
${
COMMIT
}
"
]
;
then
COMMIT
=
$(
git rev-parse HEAD
)
fi
GIT_TAG
=
${
DRONE_TAG
:-$(
git tag
-l
--contains
HEAD |
head
-n
1
)}
if
[
-d
.git
]
;
then
if
[
-z
"
$GIT_TAG
"
]
;
then
GIT_TAG
=
$(
git tag
-l
--contains
HEAD |
head
-n
1
)
fi
if
[
-n
"
$(
git status
--porcelain
--untracked-files
=
no
)
"
]
;
then
DIRTY
=
"-dirty"
TREE_STATE
=
dirty
fi
ARCH
=
$(
go
env
GOARCH
)
SUFFIX
=
"-
${
ARCH
}
"
COMMIT
=
$(
git log
-n3
--pretty
=
format:
"%H %ae"
|
grep
-v
' drone@localhost$'
|
cut
-f1
-d
\
|
head
-1
)
if
[
-z
"
${
COMMIT
}
"
]
;
then
COMMIT
=
$(
git rev-parse HEAD
||
true
)
fi
fi
VERSION_CONTAINERD
=
$(
grep
github.com/containerd/containerd go.mod |
head
-n1
|
awk
'{print $4}'
)
if
[
-z
"
$VERSION_CONTAINERD
"
]
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment