mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Jenkinsfile: use GIT_COMMIT from Git plugin instead of manually
This patch removes the manual steps to resolve the Git commit, and instead, uses the `GIT_COMMIT` that's set by Jenkins's Git plugin. Behavior changes slightly, because `GIT_PLUGIN` contains the full commit-sha, not the short one. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
a6aa11a3ef
commit
be0e6e9d34
1 changed files with 19 additions and 40 deletions
59
Jenkinsfile
vendored
59
Jenkinsfile
vendored
|
@ -44,23 +44,20 @@ pipeline {
|
||||||
# todo: include ip_vs in base image
|
# todo: include ip_vs in base image
|
||||||
sudo modprobe ip_vs
|
sudo modprobe ip_vs
|
||||||
|
|
||||||
GITCOMMIT=$(git rev-parse --short HEAD)
|
docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} .
|
||||||
docker build --force-rm --build-arg APT_MIRROR -t docker:$GITCOMMIT .
|
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("Run tests") {
|
stage("Run tests") {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
GITCOMMIT=$(git rev-parse --short HEAD)
|
|
||||||
|
|
||||||
docker run --rm -t --privileged \
|
docker run --rm -t --privileged \
|
||||||
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
|
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
|
||||||
-v "$WORKSPACE/.git:/go/src/github.com/docker/docker/.git" \
|
-v "$WORKSPACE/.git:/go/src/github.com/docker/docker/.git" \
|
||||||
--name docker-pr$BUILD_NUMBER \
|
--name docker-pr$BUILD_NUMBER \
|
||||||
-e DOCKER_GITCOMMIT=${GITCOMMIT} \
|
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \
|
||||||
-e DOCKER_GRAPHDRIVER=overlay2 \
|
-e DOCKER_GRAPHDRIVER=overlay2 \
|
||||||
docker:$GITCOMMIT \
|
docker:${GIT_COMMIT} \
|
||||||
hack/test/unit
|
hack/test/unit
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
|
@ -113,24 +110,21 @@ pipeline {
|
||||||
# todo: include ip_vs in base image
|
# todo: include ip_vs in base image
|
||||||
sudo modprobe ip_vs
|
sudo modprobe ip_vs
|
||||||
|
|
||||||
GITCOMMIT=$(git rev-parse --short HEAD)
|
docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} .
|
||||||
docker build --force-rm --build-arg APT_MIRROR -t docker:$GITCOMMIT .
|
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("Run tests") {
|
stage("Run tests") {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
GITCOMMIT=$(git rev-parse --short HEAD)
|
|
||||||
|
|
||||||
docker run --rm -t --privileged \
|
docker run --rm -t --privileged \
|
||||||
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
|
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
|
||||||
-v "$WORKSPACE/.git:/go/src/github.com/docker/docker/.git" \
|
-v "$WORKSPACE/.git:/go/src/github.com/docker/docker/.git" \
|
||||||
--name docker-pr$BUILD_NUMBER \
|
--name docker-pr$BUILD_NUMBER \
|
||||||
-e DOCKER_GITCOMMIT=${GITCOMMIT} \
|
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \
|
||||||
-e DOCKER_GRAPHDRIVER=overlay2 \
|
-e DOCKER_GRAPHDRIVER=overlay2 \
|
||||||
-e GIT_SHA1=${GIT_COMMIT} \
|
-e GIT_SHA1=${GIT_COMMIT} \
|
||||||
docker:$GITCOMMIT \
|
docker:${GIT_COMMIT} \
|
||||||
hack/ci/janky
|
hack/ci/janky
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
|
@ -138,9 +132,8 @@ pipeline {
|
||||||
stage("Build e2e image") {
|
stage("Build e2e image") {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
GITCOMMIT=$(git rev-parse --short HEAD)
|
|
||||||
echo "Building e2e image"
|
echo "Building e2e image"
|
||||||
docker build --build-arg DOCKER_GITCOMMIT=$GITCOMMIT -t moby-e2e-test -f Dockerfile.e2e .
|
docker build --build-arg DOCKER_GITCOMMIT=${GIT_COMMIT} -t moby-e2e-test -f Dockerfile.e2e .
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -187,23 +180,19 @@ pipeline {
|
||||||
}
|
}
|
||||||
stage("Build dev image") {
|
stage("Build dev image") {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh 'docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT}-exp .'
|
||||||
GITCOMMIT=$(git rev-parse --short HEAD)
|
|
||||||
docker build --force-rm --build-arg APT_MIRROR -t docker:${GITCOMMIT}-exp .
|
|
||||||
'''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("Run tests") {
|
stage("Run tests") {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
GITCOMMIT=$(git rev-parse --short HEAD)
|
|
||||||
docker run --rm -t --privileged \
|
docker run --rm -t --privileged \
|
||||||
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
|
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
|
||||||
-e DOCKER_EXPERIMENTAL=y \
|
-e DOCKER_EXPERIMENTAL=y \
|
||||||
--name docker-pr-exp$BUILD_NUMBER \
|
--name docker-pr-exp$BUILD_NUMBER \
|
||||||
-e DOCKER_GITCOMMIT=${GITCOMMIT} \
|
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \
|
||||||
-e DOCKER_GRAPHDRIVER=overlay2 \
|
-e DOCKER_GRAPHDRIVER=overlay2 \
|
||||||
docker:${GITCOMMIT}-exp \
|
docker:${GIT_COMMIT}-exp \
|
||||||
hack/ci/experimental
|
hack/ci/experimental
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
|
@ -254,22 +243,20 @@ pipeline {
|
||||||
stage("Build dev image") {
|
stage("Build dev image") {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
GITCOMMIT=$(git rev-parse --short HEAD)
|
docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} -f Dockerfile .
|
||||||
docker build --force-rm --build-arg APT_MIRROR -t docker:$GITCOMMIT -f Dockerfile .
|
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("Run tests") {
|
stage("Run tests") {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
GITCOMMIT=$(git rev-parse --short HEAD)
|
|
||||||
docker run --rm -t --privileged \
|
docker run --rm -t --privileged \
|
||||||
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
|
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
|
||||||
--name docker-pr$BUILD_NUMBER \
|
--name docker-pr$BUILD_NUMBER \
|
||||||
-e DOCKER_GRAPHDRIVER=vfs \
|
-e DOCKER_GRAPHDRIVER=vfs \
|
||||||
-e TIMEOUT="300m" \
|
-e TIMEOUT="300m" \
|
||||||
-e DOCKER_GITCOMMIT=${GITCOMMIT} \
|
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \
|
||||||
docker:$GITCOMMIT \
|
docker:${GIT_COMMIT} \
|
||||||
hack/ci/z
|
hack/ci/z
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
|
@ -319,23 +306,19 @@ pipeline {
|
||||||
}
|
}
|
||||||
stage("Build dev image") {
|
stage("Build dev image") {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh 'docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} -f Dockerfile .'
|
||||||
GITCOMMIT=$(git rev-parse --short HEAD)
|
|
||||||
docker build --force-rm --build-arg APT_MIRROR -t docker:$GITCOMMIT -f Dockerfile .
|
|
||||||
'''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("Run tests") {
|
stage("Run tests") {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
GITCOMMIT=$(git rev-parse --short HEAD)
|
|
||||||
docker run --rm -t --privileged \
|
docker run --rm -t --privileged \
|
||||||
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
|
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
|
||||||
--name docker-pr$BUILD_NUMBER \
|
--name docker-pr$BUILD_NUMBER \
|
||||||
-e DOCKER_GRAPHDRIVER=vfs \
|
-e DOCKER_GRAPHDRIVER=vfs \
|
||||||
-e DOCKER_GITCOMMIT=${GITCOMMIT} \
|
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \
|
||||||
-e TIMEOUT="180m" \
|
-e TIMEOUT="180m" \
|
||||||
docker:$GITCOMMIT \
|
docker:${GIT_COMMIT} \
|
||||||
hack/ci/powerpc
|
hack/ci/powerpc
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
|
@ -383,22 +366,18 @@ pipeline {
|
||||||
}
|
}
|
||||||
stage("Build dev image") {
|
stage("Build dev image") {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh 'docker build --force-rm --build-arg APT_MIRROR -t dockerven:${GIT_COMMIT} .'
|
||||||
GITCOMMIT=$(git rev-parse --short HEAD)
|
|
||||||
docker build --force-rm --build-arg APT_MIRROR -t dockerven:$GITCOMMIT .
|
|
||||||
'''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("Run tests") {
|
stage("Run tests") {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
GITCOMMIT=$(git rev-parse --short HEAD)
|
|
||||||
docker run --rm -t --privileged \
|
docker run --rm -t --privileged \
|
||||||
--name dockerven-pr$BUILD_NUMBER \
|
--name dockerven-pr$BUILD_NUMBER \
|
||||||
-e DOCKER_GRAPHDRIVER=vfs \
|
-e DOCKER_GRAPHDRIVER=vfs \
|
||||||
-v "$WORKSPACE/.git:/go/src/github.com/docker/docker/.git" \
|
-v "$WORKSPACE/.git:/go/src/github.com/docker/docker/.git" \
|
||||||
-e DOCKER_GITCOMMIT=${GITCOMMIT} \
|
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \
|
||||||
-e TIMEOUT=120m dockerven:$GITCOMMIT \
|
-e TIMEOUT=120m dockerven:${GIT_COMMIT} \
|
||||||
hack/validate/vendor
|
hack/validate/vendor
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue