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
a4e642b0
Kaydet (Commit)
a4e642b0
authored
Mar 15, 2018
tarafından
Joffrey F
Kaydeden (comit)
Joffrey F
Mar 15, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use networks instead of legacy links for test setup
Signed-off-by:
Joffrey F
<
joffrey@docker.com
>
üst
884261e2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
20 deletions
+30
-20
Jenkinsfile
Jenkinsfile
+9
-5
Makefile
Makefile
+21
-15
No files found.
Jenkinsfile
Dosyayı görüntüle @
a4e642b0
...
...
@@ -9,7 +9,7 @@ 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-rc
1
"
// Latest CE RC
"18.03.0-ce-rc
4
"
// Latest CE RC
]
def
buildImage
=
{
name
,
buildargs
,
pyTag
->
...
...
@@ -64,15 +64,18 @@ def runTests = { Map settings ->
checkout
(
scm
)
def
dindContainerName
=
"dpy-dind-\$BUILD_NUMBER-\$EXECUTOR_NUMBER-${pythonVersion}-${dockerVersion}"
def
testContainerName
=
"dpy-tests-\$BUILD_NUMBER-\$EXECUTOR_NUMBER-${pythonVersion}-${dockerVersion}"
def
testNetwork
=
"dpy-testnet-\$BUILD_NUMBER-\$EXECUTOR_NUMBER-${pythonVersion}-${dockerVersion}"
try
{
sh
"""docker run -d --name ${dindContainerName} -v /tmp --privileged \\
sh
"""docker network create ${testNetwork}"""
sh
"""docker run -d --name ${dindContainerName} -v /tmp --privileged --network ${testNetwork} \\
dockerswarm/dind:${dockerVersion} dockerd -H tcp://0.0.0.0:2375
"""
sh
"""docker run \\
--name ${testContainerName}
--volumes-from ${dindContainerName}
\\
-e
'DOCKER_HOST=tcp://docker:2375'
\\
--name ${testContainerName} \\
-e
"DOCKER_HOST=tcp://${dindContainerName}:2375"
\\
-e 'DOCKER_TEST_API_VERSION=${apiVersion}' \\
--link=${dindContainerName}:docker \\
--network ${testNetwork} \\
--volumes-from ${dindContainerName} \\
${testImage} \\
py.test -v -rxs tests/integration
"""
...
...
@@ -80,6 +83,7 @@ def runTests = { Map settings ->
sh
"""
docker stop ${dindContainerName} ${testContainerName}
docker rm -vf ${dindContainerName} ${testContainerName}
docker network rm ${testNetwork}
"""
}
}
...
...
Makefile
Dosyayı görüntüle @
a4e642b0
...
...
@@ -3,7 +3,7 @@ all: test
.PHONY
:
clean
clean
:
-
docker
rm
-f
dpy-dind-py2 dpy-dind-py3
-
docker
rm
-f
dpy-dind-py2 dpy-dind-py3
dpy-dind-certs dpy-dind-ssl
find
-name
"__pycache__"
| xargs
rm
-rf
.PHONY
:
build
...
...
@@ -44,41 +44,47 @@ integration-test-py3: build-py3
TEST_API_VERSION
?=
1.35
TEST_ENGINE_VERSION
?=
17.12.0-ce
.PHONY
:
setup-network
setup-network
:
docker network inspect dpy-tests
||
docker network create dpy-tests
.PHONY
:
integration-dind
integration-dind
:
integration-dind-py2 integration-dind-py3
.PHONY
:
integration-dind-py2
integration-dind-py2
:
build
integration-dind-py2
:
build
setup-network
docker
rm
-vf
dpy-dind-py2
||
:
docker run
-d
--n
ame
dpy-dind-py2
--privileged
dockerswarm/dind:
${
TEST_ENGINE_VERSION
}
docker
d
\
-H
tcp://0.0.0.0:2375
--experimental
docker run
-t
--rm
--env
=
"DOCKER_HOST=tcp://d
ocker
:2375"
--env
=
"DOCKER_TEST_API_VERSION=
${
TEST_API_VERSION
}
"
\
--
link
=
dpy-dind-py2:docker
docker-sdk-python py.test tests/integration
docker run
-d
--n
etwork
dpy-tests
--name
dpy-dind-py2
--privilege
d
\
dockerswarm/dind:
${
TEST_ENGINE_VERSION
}
dockerd
-H
tcp://0.0.0.0:2375
--experimental
docker run
-t
--rm
--env
=
"DOCKER_HOST=tcp://d
py-dind-py2
:2375"
--env
=
"DOCKER_TEST_API_VERSION=
${
TEST_API_VERSION
}
"
\
--
network
dpy-tests
docker-sdk-python py.test tests/integration
docker
rm
-vf
dpy-dind-py2
.PHONY
:
integration-dind-py3
integration-dind-py3
:
build-py3
integration-dind-py3
:
build-py3
setup-network
docker
rm
-vf
dpy-dind-py3
||
:
docker run
-d
--n
ame
dpy-dind-py3
--privileged
dockerswarm/dind:
${
TEST_ENGINE_VERSION
}
docker
d
\
-H
tcp://0.0.0.0:2375
--experimental
docker run
-t
--rm
--env
=
"DOCKER_HOST=tcp://d
ocker
:2375"
--env
=
"DOCKER_TEST_API_VERSION=
${
TEST_API_VERSION
}
"
\
--
link
=
dpy-dind-py3:docker
docker-sdk-python3 py.test tests/integration
docker run
-d
--n
etwork
dpy-tests
--name
dpy-dind-py3
--privilege
d
\
dockerswarm/dind:
${
TEST_ENGINE_VERSION
}
dockerd
-H
tcp://0.0.0.0:2375
--experimental
docker run
-t
--rm
--env
=
"DOCKER_HOST=tcp://d
py-dind-py3
:2375"
--env
=
"DOCKER_TEST_API_VERSION=
${
TEST_API_VERSION
}
"
\
--
network
dpy-tests
docker-sdk-python3 py.test tests/integration
docker
rm
-vf
dpy-dind-py3
.PHONY
:
integration-dind-ssl
integration-dind-ssl
:
build-dind-certs build build-py3
docker
rm
-vf
dpy-dind-certs dpy-dind-ssl
||
:
docker run
-d
--name
dpy-dind-certs dpy-dind-certs
docker run
-d
--env
=
"DOCKER_HOST=tcp://localhost:2375"
--env
=
"DOCKER_TLS_VERIFY=1"
\
--env
=
"DOCKER_CERT_PATH=/certs"
--volumes-from
dpy-dind-certs
--name
dpy-dind-ssl
\
-v
/tmp
--privileged
dockerswarm/dind:
${
TEST_ENGINE_VERSION
}
dockerd
--tlsverify
\
--tlscacert
=
/certs/ca.pem
--tlscert
=
/certs/server-cert.pem
\
--network
dpy-tests
--network-alias
docker
-v
/tmp
--privileged
\
dockerswarm/dind:
${
TEST_ENGINE_VERSION
}
\
dockerd
--tlsverify
--tlscacert
=
/certs/ca.pem
--tlscert
=
/certs/server-cert.pem
\
--tlskey
=
/certs/server-key.pem
-H
tcp://0.0.0.0:2375
--experimental
docker run
-t
--rm
--volumes-from
dpy-dind-ssl
--env
=
"DOCKER_HOST=tcp://docker:2375"
\
--env
=
"DOCKER_TLS_VERIFY=1"
--env
=
"DOCKER_CERT_PATH=/certs"
--env
=
"DOCKER_TEST_API_VERSION=
${
TEST_API_VERSION
}
"
\
--
link
=
dpy-dind-ssl:docker
docker-sdk-python py.test tests/integration
--
network
dpy-tests
docker-sdk-python py.test tests/integration
docker run
-t
--rm
--volumes-from
dpy-dind-ssl
--env
=
"DOCKER_HOST=tcp://docker:2375"
\
--env
=
"DOCKER_TLS_VERIFY=1"
--env
=
"DOCKER_CERT_PATH=/certs"
--env
=
"DOCKER_TEST_API_VERSION=
${
TEST_API_VERSION
}
"
\
--
link
=
dpy-dind-ssl:docker
docker-sdk-python3 py.test tests/integration
--
network
dpy-tests
docker-sdk-python3 py.test tests/integration
docker
rm
-vf
dpy-dind-ssl dpy-dind-certs
.PHONY
:
flake8
...
...
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