Skip to content

Commit

Permalink
add outerloop placeholder logic
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Mauer <[email protected]>
  • Loading branch information
ajm01 committed Feb 16, 2022
1 parent 3f2a780 commit 8af7ea0
Show file tree
Hide file tree
Showing 8 changed files with 358 additions and 28 deletions.
8 changes: 4 additions & 4 deletions customize-ol.env
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ STACK_IMAGE_MAVEN="icr.io/appcafe/open-liberty-devfile-stack:\{\{liberty-version

# URL hosting the outer loop Dockerfile for Maven deployments.
# This URL is set in the devfile to process outer-loop related actions.
OUTERLOOP_DOCKERFILE_MAVEN_LOC="https://github.com/OpenLiberty/devfile-stack/releases/download/open-liberty-maven-0.8.1/Dockerfile"
OUTERLOOP_DOCKERFILE_MAVEN_LOC="https://github.com/OpenLiberty/devfile-stack/releases/download/open-liberty-maven-0.9.0/Dockerfile"

# URL hosting the Open Liberty Operator's OpenLibertyApplication custom resource yaml to be used for Maven outer-loop deployments.
OUTERLOOP_DEPLOY_YAML_MAVEN_LOC="https://github.com/OpenLiberty/devfile-stack/releases/download/open-liberty-maven-0.8.1/app-deploy.yaml"
OUTERLOOP_DEPLOY_YAML_MAVEN_LOC="https://github.com/OpenLiberty/devfile-stack/releases/download/open-liberty-maven-0.9.0/app-deploy.yaml"

#-----------------------------------------------------------------
# Gradle specific Customization settings.
Expand All @@ -50,7 +50,7 @@ STACK_IMAGE_GRADLE="icr.io/appcafe/open-liberty-devfile-stack:\{\{liberty-versio

# URL hosting the outer-loop Dockerfile for Gradle deployments.
# This URL is set in the devfile to process outer-loop related actions.
OUTERLOOP_DOCKERFILE_GRADLE_LOC="https://github.com/OpenLiberty/devfile-stack/releases/download/open-liberty-gradle-0.3.1/Dockerfile"
OUTERLOOP_DOCKERFILE_GRADLE_LOC="https://github.com/OpenLiberty/devfile-stack/releases/download/open-liberty-gradle-0.4.0/Dockerfile"

# URL hosting the Liberty Operator's OpenLibertyApplication custom resource yaml to be used for Gradle outer-loop deployments.
OUTERLOOP_DEPLOY_YAML_GRADLE_LOC="https://github.com/OpenLiberty/devfile-stack/releases/download/open-liberty-gradle-0.3.1/app-deploy.yaml"
OUTERLOOP_DEPLOY_YAML_GRADLE_LOC="https://github.com/OpenLiberty/devfile-stack/releases/download/open-liberty-gradle-0.4.0/app-deploy.yaml"
8 changes: 4 additions & 4 deletions customize-wl.env
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ STACK_IMAGE_MAVEN="icr.io/appcafe/websphere-liberty-devfile-stack:\{\{liberty-ve

# URL hosting the outer loop Dockerfile for Maven deployments.
# This URL is set in the devfile to process outer-loop related actions.
OUTERLOOP_DOCKERFILE_MAVEN_LOC="https://github.com/OpenLiberty/devfile-stack/releases/download/websphere-liberty-maven-0.8.1/Dockerfile"
OUTERLOOP_DOCKERFILE_MAVEN_LOC="https://github.com/OpenLiberty/devfile-stack/releases/download/websphere-liberty-maven-0.9.0/Dockerfile"

# URL hosting the Liberty Operator's OpenLibertyApplication custom resource yaml to be used for Maven outer-loop deployments.
OUTERLOOP_DEPLOY_YAML_MAVEN_LOC="https://github.com/OpenLiberty/devfile-stack/releases/download/websphere-liberty-maven-0.8.1/app-deploy.yaml"
OUTERLOOP_DEPLOY_YAML_MAVEN_LOC="https://github.com/OpenLiberty/devfile-stack/releases/download/websphere-liberty-maven-0.9.0/app-deploy.yaml"

#-----------------------------------------------------------------
# Gradle specific Customization settings.
Expand All @@ -50,7 +50,7 @@ STACK_IMAGE_GRADLE="icr.io/appcafe/websphere-liberty-devfile-stack:\{\{liberty-v

# URL hosting the outer-loop Dockerfile for Gradle deployments.
# This URL is set in the devfile to process outer-loop related actions.
OUTERLOOP_DOCKERFILE_GRADLE_LOC="https://github.com/OpenLiberty/devfile-stack/releases/download/websphere-liberty-gradle-0.3.1/Dockerfile"
OUTERLOOP_DOCKERFILE_GRADLE_LOC="https://github.com/OpenLiberty/devfile-stack/releases/download/websphere-liberty-gradle-0.4.0/Dockerfile"

# URL hosting the Liberty Operator's OpenLibertyApplication custom resource yaml to be used for Gradle outer-loop deployments.
OUTERLOOP_DEPLOY_YAML_GRADLE_LOC="https://github.com/OpenLiberty/devfile-stack/releases/download/websphere-liberty-gradle-0.3.1/app-deploy.yaml"
OUTERLOOP_DEPLOY_YAML_GRADLE_LOC="https://github.com/OpenLiberty/devfile-stack/releases/download/websphere-liberty-gradle-0.4.0/app-deploy.yaml"
59 changes: 57 additions & 2 deletions src/devfiles/gradle/devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
schemaVersion: 2.1.0
schemaVersion: 2.2.0
metadata:
name: java-{{.STACK_SHORT_NAME}}-gradle
version: 0.3.1
version: 0.4.0
displayName: '{{.STACK_NAME}} Gradle'
description: Java application Gradle-built stack using the {{.STACK_NAME}} runtime
icon: https://raw.githubusercontent.com/OpenLiberty/logos/7fbb132949b9b2589e18c8d5665c1b107028a21d/logomark/svg/OL_logomark.svg
Expand All @@ -36,6 +36,8 @@ variables:
# Liberty runtime version. Minimum recommended: 21.0.0.9
liberty-version: '{{.LIBERTY_RUNTIME_VERSION}}'
gradle-cmd: 'gradle'
CONTAINER_IMAGE: 'demo-image:0'
COMPONENT_NAME: 'demo-app'
components:
- name: dev
container:
Expand All @@ -48,6 +50,26 @@ components:
name: ep1
targetPort: 9080
protocol: http
#
#deploy components
#
- name: outerloop-build-app
image:
imageName: "{{CONTAINER_IMAGE}}"
dockerfile:
# eventually should be remote stack based Dockerfile: odo github issue #5450
# ie: '{{.OUTERLOOP_DOCKERFILE_GRADLE_LOC}}'
uri: ./Dockerfile
buildContext: ${PROJECTS_ROOT}
- name: outerloop-build-stack
image:
imageName: "{{CONTAINER_IMAGE}}"
dockerfile:
uri: ./Dockerfile
buildContext: ${PROJECTS_ROOT}
- name: myk8sdeploy
kubernetes:
uri: '{{.OUTERLOOP_DEPLOY_YAML_GRADLE_LOC}}'
commands:
- id: run
exec:
Expand Down Expand Up @@ -85,3 +107,36 @@ commands:
group:
kind: test
isDefault: true
#
# Build and Deploy cmds
#

# Build an image using the stack provided dockerfile
- id: build-image-stack-provided
apply:
component: outerloop-build-stack
# Build an app image using a developer provided dockerfile
- id: build-image-app-provided
apply:
component: outerloop-build-app
# Apply an app image using the stack provided deployment manifest file
- id: outerloop-deploy
apply:
component: myk8sdeploy
# Deploy an app image built with the stack provided dockerfile - default action
- id: deploy
composite:
commands:
- build-image-stack-provided
- outerloop-deploy
group:
kind: deploy
isDefault: true
# Deploy an app image built with a developer provided dockerfile - non-default action
- id: deploy-app-image
composite:
commands:
- build-image-app-provided
- outerloop-deploy
group:
kind: deploy
59 changes: 57 additions & 2 deletions src/devfiles/maven/devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
schemaVersion: 2.1.0
schemaVersion: 2.2.0
metadata:
name: java-{{.STACK_SHORT_NAME}}
version: 0.8.1
version: 0.9.0
displayName: '{{.STACK_NAME}} Maven'
description: Java application Maven-built stack using the {{.STACK_NAME}} runtime
icon: https://raw.githubusercontent.com/OpenLiberty/logos/7fbb132949b9b2589e18c8d5665c1b107028a21d/logomark/svg/OL_logomark.svg
Expand All @@ -37,6 +37,8 @@ variables:
liberty-version: '{{.LIBERTY_RUNTIME_VERSION}}'
liberty-plugin-version: '{{.LIBERTY_MAVEN_PLUGIN_VERSION}}'
mvn-cmd: 'mvn'
CONTAINER_IMAGE: 'demo-image:0'
COMPONENT_NAME: 'demo-app'
components:
- name: dev
container:
Expand All @@ -50,6 +52,26 @@ components:
name: ep1
targetPort: 9080
protocol: http
#
#deploy components
#
- name: outerloop-build-app
image:
imageName: "{{CONTAINER_IMAGE}}"
dockerfile:
uri: ./Dockerfile
buildContext: ${PROJECTS_ROOT}
- name: outerloop-build-stack
image:
imageName: "{{CONTAINER_IMAGE}}"
dockerfile:
# eventually should be remote stack based Dockerfile: odo github issue #5450
# ie: '{{.OUTERLOOP_DOCKERFILE_MAVEN_LOC}}'
uri: ./Dockerfile
buildContext: ${PROJECTS_ROOT}
- name: myk8sdeploy
kubernetes:
uri: '{{.OUTERLOOP_DEPLOY_YAML_MAVEN_LOC}}'
commands:
- id: run
exec:
Expand Down Expand Up @@ -88,3 +110,36 @@ commands:
group:
kind: test
isDefault: true
#
# Build and Deploy cmds
#

# Build an image using the stack provided dockerfile
- id: build-image-stack-provided
apply:
component: outerloop-build-stack
# Build an app image using a developer provided dockerfile
- id: build-image-app-provided
apply:
component: outerloop-build-app
# Apply an app image using the stack provided deployment manifest file
- id: outerloop-deploy
apply:
component: myk8sdeploy
# Deploy an app image built with the stack provided dockerfile - default action
- id: deploy
composite:
commands:
- build-image-stack-provided
- outerloop-deploy
group:
kind: deploy
isDefault: true
# Deploy an app image built with a developer provided dockerfile - non-default action
- id: deploy-app-image
composite:
commands:
- build-image-app-provided
- outerloop-deploy
group:
kind: deploy
63 changes: 59 additions & 4 deletions stack/open-liberty/devfiles/gradle/devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
schemaVersion: 2.1.0
schemaVersion: 2.2.0
metadata:
name: java-openliberty-gradle
version: 0.3.1
version: 0.4.0
displayName: 'Open Liberty Gradle'
description: Java application Gradle-built stack using the Open Liberty runtime
icon: https://raw.githubusercontent.com/OpenLiberty/logos/7fbb132949b9b2589e18c8d5665c1b107028a21d/logomark/svg/OL_logomark.svg
tags: ['Java', 'Gradle']
architectures: ['amd64', 'ppc64le', 's390x']
language: 'java'
projectType: 'openliberty'
alpha.build-dockerfile: 'https://github.com/OpenLiberty/devfile-stack/releases/download/open-liberty-gradle-0.3.1/Dockerfile'
alpha.deployment-manifest: 'https://github.com/OpenLiberty/devfile-stack/releases/download/open-liberty-gradle-0.3.1/app-deploy.yaml'
alpha.build-dockerfile: 'https://github.com/OpenLiberty/devfile-stack/releases/download/open-liberty-gradle-0.4.0/Dockerfile'
alpha.deployment-manifest: 'https://github.com/OpenLiberty/devfile-stack/releases/download/open-liberty-gradle-0.4.0/app-deploy.yaml'
starterProjects:
- name: rest
git:
Expand All @@ -36,6 +36,8 @@ variables:
# Liberty runtime version. Minimum recommended: 21.0.0.9
liberty-version: '22.0.0.1'
gradle-cmd: 'gradle'
CONTAINER_IMAGE: 'demo-image:0'
COMPONENT_NAME: 'demo-app'
components:
- name: dev
container:
Expand All @@ -48,6 +50,26 @@ components:
name: ep1
targetPort: 9080
protocol: http
#
#deploy components
#
- name: outerloop-build-app
image:
imageName: "{{CONTAINER_IMAGE}}"
dockerfile:
# eventually should be remote stack based Dockerfile: odo github issue #5450
# ie: 'https://github.com/OpenLiberty/devfile-stack/releases/download/open-liberty-gradle-0.4.0/Dockerfile'
uri: ./Dockerfile
buildContext: ${PROJECTS_ROOT}
- name: outerloop-build-stack
image:
imageName: "{{CONTAINER_IMAGE}}"
dockerfile:
uri: ./Dockerfile
buildContext: ${PROJECTS_ROOT}
- name: myk8sdeploy
kubernetes:
uri: 'https://github.com/OpenLiberty/devfile-stack/releases/download/open-liberty-gradle-0.4.0/app-deploy.yaml'
commands:
- id: run
exec:
Expand Down Expand Up @@ -85,3 +107,36 @@ commands:
group:
kind: test
isDefault: true
#
# Build and Deploy cmds
#

# Build an image using the stack provided dockerfile
- id: build-image-stack-provided
apply:
component: outerloop-build-stack
# Build an app image using a developer provided dockerfile
- id: build-image-app-provided
apply:
component: outerloop-build-app
# Apply an app image using the stack provided deployment manifest file
- id: outerloop-deploy
apply:
component: myk8sdeploy
# Deploy an app image built with the stack provided dockerfile - default action
- id: deploy
composite:
commands:
- build-image-stack-provided
- outerloop-deploy
group:
kind: deploy
isDefault: true
# Deploy an app image built with a developer provided dockerfile - non-default action
- id: deploy-app-image
composite:
commands:
- build-image-app-provided
- outerloop-deploy
group:
kind: deploy
Loading

0 comments on commit 8af7ea0

Please sign in to comment.