-
Notifications
You must be signed in to change notification settings - Fork 518
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: images can be configured with properties
Signed-off-by: Marc Nuri <marc@marcnuri.com>
- Loading branch information
Showing
26 changed files
with
952 additions
and
1,557 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
gradle-plugin/it/src/it/image-from-properties/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2019 Red Hat, Inc. | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at: | ||
* | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
*/ | ||
plugins { | ||
id 'org.eclipse.jkube.kubernetes' version "${jKubeVersion}" | ||
id 'java' | ||
} | ||
|
||
group = 'org.eclipse.jkube.integration.tests.gradle' | ||
version = '0.0.1-SNAPSHOT' | ||
sourceCompatibility = '11' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
kubernetes { | ||
offline = true | ||
images { | ||
image { | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
gradle-plugin/it/src/it/image-from-properties/gradle.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# | ||
# Copyright (c) 2019 Red Hat, Inc. | ||
# This program and the accompanying materials are made | ||
# available under the terms of the Eclipse Public License 2.0 | ||
# which is available at: | ||
# | ||
# https://www.eclipse.org/legal/epl-2.0/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
# Contributors: | ||
# Red Hat, Inc. - initial API and implementation | ||
# | ||
|
||
jkube.build.strategy=jib | ||
jkube.container-image.name=repository/image-from-properties:latest | ||
jkube.container-image.from=quay.io/quay/busybox | ||
jkube.container-image.env.JAVA_OPTIONS=-Xmx256m | ||
jkube.container-image.labels.MAINTAINER=JKube testing team | ||
jkube.container-image.assembly.targetDir='/deployments' | ||
jkube.container-image.ports.1=8080 | ||
jkube.container-image.entrypoint=java -jar /app.jar |
49 changes: 49 additions & 0 deletions
49
...-plugin/it/src/test/java/org/eclipse/jkube/gradle/plugin/tests/ImageFromPropertiesIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright (c) 2019 Red Hat, Inc. | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at: | ||
* | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
*/ | ||
package org.eclipse.jkube.gradle.plugin.tests; | ||
|
||
import org.gradle.testkit.runner.BuildResult; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
|
||
import static org.assertj.core.api.AssertionsForClassTypes.assertThat; | ||
|
||
class ImageFromPropertiesIT { | ||
@RegisterExtension | ||
private final ITGradleRunnerExtension gradleRunner = new ITGradleRunnerExtension(); | ||
|
||
@Test | ||
void k8sBuild_generatesConfiguredImage() throws IOException { | ||
// When | ||
final BuildResult result = gradleRunner.withITProject("image-from-properties") | ||
.withArguments("clean", "build", "k8sBuild", "--stacktrace") | ||
.build(); | ||
// Then | ||
final File dockerFile = gradleRunner.resolveFile("build", "docker", "repository", "image-from-properties", "latest", "build", "Dockerfile"); | ||
assertThat(new String(Files.readAllBytes(dockerFile.toPath()))) | ||
.contains("FROM quay.io/quay/busybox") | ||
.contains("ENV JAVA_OPTIONS=-Xmx256m") | ||
.contains("LABEL MAINTAINER=\"JKube testing team\"") | ||
.contains("EXPOSE 8080") | ||
.contains("COPY /jkube-generated-layer-final-artifact/maven /maven/") | ||
.contains("ENTRYPOINT java -jar /app.jar"); | ||
assertThat(result).extracting(BuildResult::getOutput).asString() | ||
.contains("Building container image in Kubernetes mode") | ||
.contains("JIB image build started"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
291 changes: 0 additions & 291 deletions
291
...n/java/org/eclipse/jkube/kit/build/api/config/handler/property/PropertyConfigHandler.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.