Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
docker-py
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
docker-py
Commits
73a90037
Kaydet (Commit)
73a90037
authored
Mar 22, 2018
tarafından
Joffrey F
Kaydeden (comit)
Joffrey F
Mar 29, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Generate test engines list dynamically
Signed-off-by:
Joffrey F
<
joffrey@docker.com
>
üst
e9f31e1e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
8 deletions
+92
-8
Jenkinsfile
Jenkinsfile
+21
-8
versions.py
scripts/versions.py
+71
-0
No files found.
Jenkinsfile
Dosyayı görüntüle @
73a90037
...
...
@@ -5,13 +5,6 @@ def imageNamePy2
def
imageNamePy3
def
images
=
[:]
def
dockerVersions
=
[
"17.06.2-ce"
,
// Latest EE
"17.12.1-ce"
,
// Latest CE stable
"18.02.0-ce"
,
// Latest CE edge
"18.03.0-ce-rc4"
// Latest CE RC
]
def
buildImage
=
{
name
,
buildargs
,
pyTag
->
img
=
docker
.
image
(
name
)
try
{
...
...
@@ -37,9 +30,27 @@ def buildImages = { ->
}
}
def
getDockerVersions
=
{
->
def
dockerVersions
=
[
"17.06.2-ce"
]
wrappedNode
(
label:
"ubuntu && !zfs"
)
{
def
result
=
sh
(
script:
"""docker run --rm \\
--entrypoint=python \\
${imageNamePy3} \\
/src/scripts/versions.py
"""
,
returnStdout:
true
)
dockerVersions
=
dockerVersions
+
result
.
trim
().
tokenize
(
' '
)
}
return
dockerVersions
}
def
getAPIVersion
=
{
engineVersion
->
def
versionMap
=
[
'17.06'
:
'1.30'
,
'17.12'
:
'1.35'
,
'18.02'
:
'1.36'
,
'18.03'
:
'1.37'
]
return
versionMap
[
engineVersion
.
substring
(
0
,
5
)]
def
result
=
versionMap
[
engineVersion
.
substring
(
0
,
5
)]
if
(!
result
)
{
return
'1.37'
}
return
result
}
def
runTests
=
{
Map
settings
->
...
...
@@ -94,6 +105,8 @@ def runTests = { Map settings ->
buildImages
()
def
dockerVersions
=
getDockerVersions
()
def
testMatrix
=
[
failFast:
false
]
for
(
imgKey
in
new
ArrayList
(
images
.
keySet
()))
{
...
...
scripts/versions.py
0 → 100644
Dosyayı görüntüle @
73a90037
import
operator
import
re
from
collections
import
namedtuple
import
requests
base_url
=
'https://download.docker.com/linux/static/{0}/x86_64/'
categories
=
[
'edge'
,
'stable'
,
'test'
]
class
Version
(
namedtuple
(
'_Version'
,
'major minor patch rc edition'
)):
@classmethod
def
parse
(
cls
,
version
):
edition
=
None
version
=
version
.
lstrip
(
'v'
)
version
,
_
,
rc
=
version
.
partition
(
'-'
)
if
rc
:
if
'rc'
not
in
rc
:
edition
=
rc
rc
=
None
elif
'-'
in
rc
:
edition
,
rc
=
rc
.
split
(
'-'
)
major
,
minor
,
patch
=
version
.
split
(
'.'
,
3
)
return
cls
(
major
,
minor
,
patch
,
rc
,
edition
)
@property
def
major_minor
(
self
):
return
self
.
major
,
self
.
minor
@property
def
order
(
self
):
"""Return a representation that allows this object to be sorted
correctly with the default comparator.
"""
# rc releases should appear before official releases
rc
=
(
0
,
self
.
rc
)
if
self
.
rc
else
(
1
,
)
return
(
int
(
self
.
major
),
int
(
self
.
minor
),
int
(
self
.
patch
))
+
rc
def
__str__
(
self
):
rc
=
'-{}'
.
format
(
self
.
rc
)
if
self
.
rc
else
''
edition
=
'-{}'
.
format
(
self
.
edition
)
if
self
.
edition
else
''
return
'.'
.
join
(
map
(
str
,
self
[:
3
]))
+
edition
+
rc
def
main
():
results
=
set
()
for
url
in
[
base_url
.
format
(
cat
)
for
cat
in
categories
]:
res
=
requests
.
get
(
url
)
content
=
res
.
text
versions
=
[
Version
.
parse
(
v
.
strip
(
'"'
)
.
lstrip
(
'docker-'
)
.
rstrip
(
'.tgz'
)
.
rstrip
(
'-x86_64'
)
)
for
v
in
re
.
findall
(
r'"docker-[0-9]+\.[0-9]+\.[0-9]+-.*tgz"'
,
content
)
]
sorted_versions
=
sorted
(
versions
,
reverse
=
True
,
key
=
operator
.
attrgetter
(
'order'
)
)
latest
=
sorted_versions
[
0
]
results
.
add
(
str
(
latest
))
print
(
' '
.
join
(
results
))
if
__name__
==
'__main__'
:
main
()
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