apiVersion: v1 kind: Template metadata: name: wildfly-s2i-chained-build-template annotations: iconClass: icon-wildfly openshift.io/display-name: WildFly S2I Chained Build openshift.io/provider-display-name: Red Hat, Inc. template.openshift.io/long-description: S2I build of WildFly application (-build-artifacts image) followed by a build to create a lightweight application image ( image). image can then be managed by the WildFly Operator. description: S2I build of WildFly application (-build-artifacts image) followed by a build to create a lightweight application image ( image). image can then be managed by the WildFly Operator. message: Builds created. labels: template: wildfly-s2i-chained-build-template parameters: - name: APPLICATION_NAME description: The application name. Name is assigned to all of the application objects defined in this template. displayName: Image Name required: true value: wildfly-app - name: GIT_REPO description: The application git repository displayName: git repository required: true value: https://github.com/openshift/openshift-jee-sample.git - name: GIT_CONTEXT_DIR description: The application git repository sub directory displayName: git repository sub directory required: false value: - name: GIT_BRANCH description: The application git branch displayName: git branch required: false value: master - name: IMAGE_STREAM_NAMESPACE description: Namespace in which the ImageStreams for WildFly images are installed. These ImageStreams are normally installed in the openshift namespace. You should only need to modify this if you've installed the ImageStreams in a different namespace/project. displayName: ImageStreams Namespace required: true value: openshift - name: GALLEON_PROVISION_LAYERS description: A comma separated lists of galleon layers to provision. The main layers are cloud-server, jaxrs-server and datasources-web-server. You can check documentation to get more details on layers. displayName: List of Galleon layers. required: false value: objects: - apiVersion: image.openshift.io/v1 kind: ImageStream metadata: labels: app: ${APPLICATION_NAME} name: ${APPLICATION_NAME} - apiVersion: image.openshift.io/v1 kind: ImageStream metadata: labels: app: ${APPLICATION_NAME}-build-artifacts name: ${APPLICATION_NAME}-build-artifacts - apiVersion: build.openshift.io/v1 kind: BuildConfig metadata: labels: app: ${APPLICATION_NAME}-build-artifacts name: ${APPLICATION_NAME}-build-artifacts spec: output: to: kind: ImageStreamTag name: ${APPLICATION_NAME}-build-artifacts:latest runPolicy: Serial source: git: ref: ${GIT_BRANCH} uri: ${GIT_REPO} contextDir: ${GIT_CONTEXT_DIR} type: Git strategy: sourceStrategy: from: kind: ImageStreamTag name: wildfly:latest namespace: ${IMAGE_STREAM_NAMESPACE} env: - name: "GALLEON_PROVISION_LAYERS" value: ${GALLEON_PROVISION_LAYERS} - name: "GALLEON_PROVISION_DEFAULT_FAT_SERVER" value: "true" type: Source triggers: - imageChange: type: ImageChange - type: ConfigChange - apiVersion: build.openshift.io/v1 kind: BuildConfig metadata: labels: app: ${APPLICATION_NAME} name: ${APPLICATION_NAME} spec: output: to: kind: ImageStreamTag name: ${APPLICATION_NAME}:latest source: dockerfile: |- FROM wildfly-runtime-centos7:latest COPY /server $JBOSS_HOME USER root RUN chown -R jboss:root $JBOSS_HOME && chmod -R ug+rwX $JBOSS_HOME RUN ln -s $JBOSS_HOME /wildfly USER jboss CMD $JBOSS_HOME/bin/openshift-launch.sh images: - from: kind: ImageStreamTag name: ${APPLICATION_NAME}-build-artifacts:latest paths: - sourcePath: /s2i-output/server/ destinationDir: "." strategy: dockerStrategy: imageOptimizationPolicy: SkipLayers from: kind: ImageStreamTag name: wildfly-runtime:latest namespace: ${IMAGE_STREAM_NAMESPACE} type: Docker triggers: - type: ImageChange imageChange: from: kind: ImageStreamTag name: ${APPLICATION_NAME}-build-artifacts:latest - type: ConfigChange