diff --git a/devfile.yaml b/devfile.yaml index 95ed163d9..07862cce7 100644 --- a/devfile.yaml +++ b/devfile.yaml @@ -1,33 +1,35 @@ -schemaVersion: 2.0.0 +schemaVersion: 2.2.0 metadata: name: java-springboot version: 1.1.0 attributes: - alpha.build-context: . - alpha.build-dockerfile: docker/Dockerfile + alpha.dockerimage-port: 8081 displayName: Java Spring Boot description: Java Spring Boot using Maven tags: ["Java", "Spring"] projectType: "springboot" language: "java" + provider: Red Hat + supportUrl: https://github.com/devfile-samples/devfile-support#support-information starterProjects: - name: springbootproject git: remotes: origin: "https://github.com/odo-devfiles/springboot-ex.git" components: - - name: buildguidance - attributes: - tool: console-import - container: - image: buildguidanceimage-placeholder - memoryLimit: 1024Mi - endpoints: - - name: http-8081 - targetPort: 8081 + - name: outerloop-build + image: + imageName: java-springboot-image:latest + dockerfile: + uri: docker/Dockerfile + buildContext: . + rootRequired: false + - name: outerloop-deploy + kubernetes: + uri: outerloop-deploy.yaml - name: tools container: - image: quay.io/eclipse/che-java11-maven:nightly + image: quay.io/eclipse/che-java11-maven:7.36.0 memoryLimit: 768Mi mountSources: true endpoints: @@ -61,3 +63,17 @@ commands: group: kind: debug isDefault: true + - id: build-image + apply: + component: outerloop-build + - id: deployk8s + apply: + component: outerloop-deploy + - id: deploy + composite: + commands: + - build-image + - deployk8s + group: + kind: deploy + isDefault: true diff --git a/outerloop-deploy.yaml b/outerloop-deploy.yaml new file mode 100644 index 000000000..89e587ed4 --- /dev/null +++ b/outerloop-deploy.yaml @@ -0,0 +1,25 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: my-java-springboot +spec: + replicas: 1 + selector: + matchLabels: + app: java-springboot-app + template: + metadata: + labels: + app: java-springboot-app + spec: + containers: + - name: my-java-springboot + image: java-springboot-image:latest + ports: + - name: http + containerPort: 8081 + protocol: TCP + resources: + limits: + memory: "1024Mi" + cpu: "500m"