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
a0961042
Unverified
Commit
a0961042
authored
Feb 14, 2020
by
Erik Wilson
Committed by
GitHub
Feb 14, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1418 from erikwilson/release-1.17
Create a latest tag in docker hub for new releases (release-1.17 branch)
parents
bb458152
57a7ece3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
5 deletions
+31
-5
manifest
scripts/manifest
+31
-5
No files found.
scripts/manifest
View file @
a0961042
...
@@ -7,10 +7,36 @@ fi
...
@@ -7,10 +7,36 @@ fi
set
-e
-x
set
-e
-x
export
REPO
=
"rancher/k3s"
REPO
=
"rancher/k3s"
export
DRONE_TAG
=
$(
echo
"
${
DRONE_TAG
}
"
|
sed
-e
's/+/-/g'
)
export
PLUGIN_TARGET
=
"
${
REPO
}
:
${
DRONE_TAG
}
"
# docker can not contain '+' in the tag, so transform '+' to '-'
export
PLUGIN_TEMPLATE
=
"
${
REPO
}
:
${
DRONE_TAG
}
-ARCH"
DOCKER_TAG
=
$(
echo
"
${
DRONE_TAG
}
"
|
sed
-e
's/+/-/g'
)
# export variables for drone-manifest
export
PLUGIN_TEMPLATE
=
"
${
REPO
}
:
${
DOCKER_TAG
}
-ARCH"
export
PLUGIN_PLATFORMS
=
"linux/amd64,linux/arm64,linux/arm"
export
PLUGIN_PLATFORMS
=
"linux/amd64,linux/arm64,linux/arm"
drone-manifest
# push current version manifest tag to docker hub
PLUGIN_TARGET
=
"
${
REPO
}
:
${
DOCKER_TAG
}
"
drone-manifest
# do not tag in docker as latest if the github tag contains a '-'
if
echo
"
${
DRONE_TAG
}
"
|
grep
-q
'-'
;
then
exit
0
fi
# get latest released version from github
GITHUB_URL
=
https://github.com/rancher/k3s/releases
VERSION_K3S
=
$(
curl
-w
'%{url_effective}'
-I
-L
-s
-S
${
GITHUB_URL
}
/latest
-o
/dev/null |
sed
-e
's|.*/||'
)
# function for comparing versions
version_ge
()
{
[
"
$1
"
=
"
$2
"
]
||
[
"
$(
printf
'%s\n'
"
$@
"
|
sort
-V
|
head
-n
1
)
"
!=
"
$1
"
]
}
# do not tag in docker as latest if we are not greater than or equal to the latest github tag
if
!
version_ge
"
${
DRONE_TAG
}
"
"
${
VERSION_K3S
}
"
;
then
exit
0
fi
# push latest manifest tag to docker hub
PLUGIN_TARGET
=
"
${
REPO
}
:latest"
drone-manifest
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