Merge pull request #4228 from Cellane/patch-1
Fix tags:deploy command for images that contain ONBUILD directive
This commit is contained in:
2 files changed
+41
-2
No files matched your search
@@ -15,7 +15,11 @@ trigger-builder-dockerfile-builder-release() {
|
|||||||
plugn trigger pre-release-dockerfile "$APP" "$IMAGE_TAG"
|
plugn trigger pre-release-dockerfile "$APP" "$IMAGE_TAG"
|
||||||
|
|
||||||
local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
|
local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
|
||||||
echo "FROM $IMAGE" | suppress_output "$DOCKER_BIN" image build --label=com.dokku.image-stage=release --label=com.dokku.app-name=$APP --label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku -t "$IMAGE" -
|
if "$DOCKER_BIN" image history --format "{{ json . }}" "$IMAGE" | grep -q "ONBUILD"; then
|
||||||
|
dokku_log_warn "Image contains one or more ONBUILD directives, skipping label injection"
|
||||||
|
else
|
||||||
|
echo "FROM $IMAGE" | suppress_output "$DOCKER_BIN" image build --label=com.dokku.image-stage=release --label=com.dokku.app-name=$APP --label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku -t "$IMAGE" -
|
||||||
|
fi
|
||||||
plugn trigger post-release-dockerfile "$APP" "$IMAGE_TAG"
|
plugn trigger post-release-dockerfile "$APP" "$IMAGE_TAG"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+36
-1
@@ -4,7 +4,7 @@ load test_helper
|
|||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
global_setup
|
global_setup
|
||||||
deploy_app
|
create_app
|
||||||
}
|
}
|
||||||
|
|
||||||
teardown() {
|
teardown() {
|
||||||
@@ -20,10 +20,16 @@ teardown() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "(tags) tags:create, tags, tags:destroy" {
|
@test "(tags) tags:create, tags, tags:destroy" {
|
||||||
|
run deploy_app
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
run /bin/bash -c "dokku tags:create $TEST_APP v0.9.0"
|
run /bin/bash -c "dokku tags:create $TEST_APP v0.9.0"
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
assert_success
|
||||||
|
|
||||||
run /bin/bash -c "dokku tags $TEST_APP | grep -q -E 'v0.9.0'"
|
run /bin/bash -c "dokku tags $TEST_APP | grep -q -E 'v0.9.0'"
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
@@ -40,6 +46,11 @@ teardown() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "(tags) tags:deploy" {
|
@test "(tags) tags:deploy" {
|
||||||
|
run deploy_app
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
run /bin/bash -c "dokku tags:create $TEST_APP v0.9.0"
|
run /bin/bash -c "dokku tags:create $TEST_APP v0.9.0"
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
@@ -64,3 +75,27 @@ teardown() {
|
|||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_failure
|
assert_failure
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "(tags) tags:deploy (onbuild)" {
|
||||||
|
run /bin/bash -c "docker image pull gliderlabs/logspout:v3.2.13"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "docker image tag gliderlabs/logspout:v3.2.13 dokku/$TEST_APP:3.2.13"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku storage:mount $TEST_APP /var/run/docker.sock:/var/run/docker.sock"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
run /bin/bash -c "dokku tags:deploy $TEST_APP 3.2.13"
|
||||||
|
echo "output: $output"
|
||||||
|
echo "status: $status"
|
||||||
|
assert_output_contains "Image contains one or more ONBUILD directives, skipping label injection"
|
||||||
|
assert_output_contains "COPY failed" 0
|
||||||
|
assert_success
|
||||||
|
}
|
||||||
Reference in new issue
Block a user