From 5e8a4b88719aa891d9eebaae996c48d3438a395c Mon Sep 17 00:00:00 2001 From: Dacal Cantos Date: Tue, 13 Feb 2018 09:23:40 +0100 Subject: [PATCH 1/4] removed required from context templates --- README.md | 2 +- build.sh | 4 ++-- templates/devonfw/devonfw-angular-template.json | 2 +- templates/devonfw/devonfw-java-template.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 95cbf9f..aab93fd 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Now, it's time to create devonfw templates to use this s2i and add it to the bro #### Build All -Use script `build.sh` to automatically install and build all image streams. The script also creates devonfw-angular and devonfw-java inside the project 'openshift'. +Use script `build.sh` to automatically install and build all image streams. The script also creates templates devonfw-angular and devonfw-java inside the project 'openshift' to be used by everyone. 1. Open a bash shell as Administrator 2. Execute shell file: diff --git a/build.sh b/build.sh index e9718bd..656920b 100644 --- a/build.sh +++ b/build.sh @@ -26,7 +26,7 @@ echo -e "${BLUE} _ _ _ ${NC}" -echo "Login as admin" +echo "You must login as admin, wait a moment..." oc login oc adm policy add-cluster-role-to-user cluster-admin system @@ -38,7 +38,7 @@ oc new-project devonfw --display-name='DevonFW' --description='DevonFW' ## Create base-images and add them to DevonFW project ### this files are private, to share it, you must enter in Git with a valid user, open the file and press RAW Button to generate a valid token -oc create -f https://raw.githubusercontent.com/oasp/s2i/master/s2i/angular/s2i-devonfw-java-imagestream.json --namespace=devonfw +oc create -f https://raw.githubusercontent.com/oasp/s2i/master/s2i/java/s2i-devonfw-java-imagestream.json --namespace=devonfw oc create -f https://raw.githubusercontent.com/oasp/s2i/master/s2i/angular/s2i-devonfw-angular-imagestream.json --namespace=devonfw ## Build base-images in DevonFW project diff --git a/templates/devonfw/devonfw-angular-template.json b/templates/devonfw/devonfw-angular-template.json index 373dcb0..dec4bd1 100644 --- a/templates/devonfw/devonfw-angular-template.json +++ b/templates/devonfw/devonfw-angular-template.json @@ -64,7 +64,7 @@ { "description": "Git directory context, example: /angular", "name": "CONTEXT_DIR", - "displayName": "Git repository CONTEXT", + "displayName": "Git repository CONTEXT" }, { "description": "Github trigger secret", diff --git a/templates/devonfw/devonfw-java-template.json b/templates/devonfw/devonfw-java-template.json index cb54eb4..4df63b2 100644 --- a/templates/devonfw/devonfw-java-template.json +++ b/templates/devonfw/devonfw-java-template.json @@ -53,7 +53,7 @@ { "description": "Git directory context, example: /java/mtsj", "name": "CONTEXT_DIR", - "displayName": "Git repository CONTEXT", + "displayName": "Git repository CONTEXT" }, { "description": "Application options. These options will be passed to the Spring Boot command line", From 1bb416e88035d67e151d4d8856c4f59b24124a0d Mon Sep 17 00:00:00 2001 From: Dacal Cantos Date: Wed, 14 Feb 2018 12:21:10 +0100 Subject: [PATCH 2/4] add yaml s2i and yaml devonfw templates --- .../s2i-devonfw-angular-imagestream.yaml | 47 +++++ s2i/java/s2i-devonfw-java-imagestream.yaml | 46 +++++ .../devonfw/devonfw-angular-template.yaml | 189 +++++++++++++++++ templates/devonfw/devonfw-java-template.yaml | 190 ++++++++++++++++++ 4 files changed, 472 insertions(+) create mode 100644 s2i/angular/s2i-devonfw-angular-imagestream.yaml create mode 100644 s2i/java/s2i-devonfw-java-imagestream.yaml create mode 100644 templates/devonfw/devonfw-angular-template.yaml create mode 100644 templates/devonfw/devonfw-java-template.yaml diff --git a/s2i/angular/s2i-devonfw-angular-imagestream.yaml b/s2i/angular/s2i-devonfw-angular-imagestream.yaml new file mode 100644 index 0000000..904d4a7 --- /dev/null +++ b/s2i/angular/s2i-devonfw-angular-imagestream.yaml @@ -0,0 +1,47 @@ +kind: List +apiVersion: v1 +metadata: + name: s2i-devonfw-angular +items: +- kind: BuildConfig + apiVersion: v1 + metadata: + name: s2i-devonfw-angular + spec: + triggers: + - type: GitHub + github: + secret: secret + - type: Generic + generic: + secret: secret + - type: ImageChange + imageChange: {} + source: + type: Git + git: + uri: https://github.com/oasp/s2i.git + ref: master + strategy: + type: Docker + dockerStrategy: + dockerfilePath: s2i/angular/Dockerfile + output: + to: + kind: ImageStreamTag + name: s2i-devonfw-angular:latest + resources: {} +- kind: ImageStream + apiVersion: v1 + metadata: + name: s2i-devonfw-angular + spec: + tags: + - name: latest + annotations: + description: The Open Application Standard Platform S2I image + iconClass: icon-nodejs + tags: builder,oasp,microservices,javascript,angular + supports: oasp:2.4 + sampleRepo: https://github.com/oasp/s2i.git + version: '1.0' diff --git a/s2i/java/s2i-devonfw-java-imagestream.yaml b/s2i/java/s2i-devonfw-java-imagestream.yaml new file mode 100644 index 0000000..e8c661d --- /dev/null +++ b/s2i/java/s2i-devonfw-java-imagestream.yaml @@ -0,0 +1,46 @@ +kind: List +apiVersion: v1 +metadata: + name: s2i-devonfw-java +items: +- kind: BuildConfig + apiVersion: v1 + metadata: + name: s2i-devonfw-java + spec: + triggers: + - type: GitHub + github: + secret: secret + - type: Generic + generic: + secret: secret + - type: ImageChange + imageChange: {} + source: + type: Git + git: + uri: https://github.com/oasp/s2i.git + ref: master + strategy: + type: Docker + dockerStrategy: + dockerfilePath: s2i/java/Dockerfile + output: + to: + kind: ImageStreamTag + name: s2i-devonfw-java:latest + resources: {} +- kind: ImageStream + apiVersion: v1 + metadata: + name: s2i-devonfw-java + spec: + tags: + - name: latest + annotations: + description: The Open Application Standard Platform for Java S2I image + iconClass: icon-java + tags: builder,java,maven,springboot,oasp,microservices,fatjar + supports: java:8,maven:3,oasp:2.4 + version: '1.0' diff --git a/templates/devonfw/devonfw-angular-template.yaml b/templates/devonfw/devonfw-angular-template.yaml new file mode 100644 index 0000000..34e307e --- /dev/null +++ b/templates/devonfw/devonfw-angular-template.yaml @@ -0,0 +1,189 @@ +kind: List +apiVersion: v1 +metadata: + name: s2i-devonfw +items: +- kind: Template + apiVersion: v1 + metadata: + name: devonfw-angular + annotations: + description: DevonFW application (angular/front-end) + openshift.io/display-name: DevonFW Angular + iconClass: devonfw-angular-logo + tags: instant-app,devonfw,javascript,angular + labels: + createdBy: devonfw-angular + parameters: + - description: 'The name for the application. It can''t contain whitespaces. It + should be the app name including technology, example: mythaistar-angular' + name: APPLICATION_NAME + displayName: Application name + required: true + - description: 'The name for the group list of applications. It can''t contain whitespaces. + It should be the app name excluding technology, example: My-Thai-Star' + name: APPLICATION_GROUP_NAME + displayName: Application group name + required: true + - description: 'Custom hostname for service routes. Leave blank for default hostname, + e.g.: ..' + name: APPLICATION_HOSTNAME + displayName: Application hostname + - description: The pattern URL of the backend's REST API endpoint inside the source + code that is supposed to be modified by the REST Endpoint URL field. + name: REST_ENDPOINT_PATTERN + displayName: REST Endpoint PATTERN URL + value: http://localhost:8081 + - description: The URL of the backend's REST API endpoint + name: REST_ENDPOINT_URL + displayName: REST Endpoint URL + - description: 'Git source URI for application, example: https://github.com/oasp/my-thai-star.git' + name: GIT_URI + displayName: Git repository URI + required: true + - description: 'Git branch/tag reference, example: develop' + name: GIT_REF + displayName: Git repository BRANCH + required: true + - description: 'Git directory context, example: /angular' + name: CONTEXT_DIR + displayName: Git repository CONTEXT + - description: Github trigger secret + name: GITHUB_TRIGGER_SECRET + from: "[a-zA-Z0-9]{8}" + generate: expression + - description: Generic build trigger secret + name: GENERIC_TRIGGER_SECRET + from: "[a-zA-Z0-9]{8}" + generate: expression + objects: + - kind: BuildConfig + apiVersion: v1 + metadata: + name: "${APPLICATION_NAME}" + labels: + app: "${APPLICATION_GROUP_NAME}" + application: "${APPLICATION_NAME}" + spec: + triggers: + - type: GitHub + github: + secret: "${GITHUB_TRIGGER_SECRET}" + - type: Generic + generic: + secret: "${GENERIC_TRIGGER_SECRET}" + - type: ImageChange + imageChange: {} + source: + type: Git + git: + uri: "${GIT_URI}" + ref: "${GIT_REF}" + contextDir: "${CONTEXT_DIR}" + strategy: + type: Source + sourceStrategy: + from: + kind: ImageStreamTag + namespace: devonfw + name: s2i-devonfw-angular:latest + env: + - name: REST_ENDPOINT_URL + value: "${REST_ENDPOINT_URL}" + - name: REST_ENDPOINT_PATTERN + value: "${REST_ENDPOINT_PATTERN}" + - name: BUILD_TARGET + value: prod + - name: ARTIFACT_DIR + value: dist + output: + to: + kind: ImageStreamTag + name: "${APPLICATION_NAME}:latest" + resources: {} + - kind: ImageStream + apiVersion: v1 + metadata: + name: "${APPLICATION_NAME}" + labels: + app: "${APPLICATION_GROUP_NAME}" + application: "${APPLICATION_NAME}" + spec: + dockerImageRepository: '' + tags: + - name: latest + - kind: DeploymentConfig + apiVersion: v1 + metadata: + name: "${APPLICATION_NAME}" + labels: + app: "${APPLICATION_GROUP_NAME}" + application: "${APPLICATION_NAME}" + spec: + strategy: + type: Rolling + rollingParams: + updatePeriodSeconds: 1 + intervalSeconds: 1 + timeoutSeconds: 600 + resources: {} + triggers: + - type: ConfigChange + - type: ImageChange + imageChangeParams: + automatic: true + containerNames: + - "${APPLICATION_NAME}" + from: + kind: ImageStreamTag + name: "${APPLICATION_NAME}:latest" + replicas: 1 + selector: + deploymentconfig: "${APPLICATION_NAME}" + template: + metadata: + labels: + deploymentconfig: "${APPLICATION_NAME}" + spec: + containers: + - name: "${APPLICATION_NAME}" + image: "${APPLICATION_NAME}" + ports: + - containerPort: 8080 + protocol: TCP + resources: {} + terminationMessagePath: "/dev/termination-log" + imagePullPolicy: IfNotPresent + securityContext: + capabilities: {} + privileged: false + restartPolicy: Always + dnsPolicy: ClusterFirst + - kind: Route + apiVersion: v1 + metadata: + name: "${APPLICATION_NAME}" + labels: + app: "${APPLICATION_GROUP_NAME}" + application: "${APPLICATION_NAME}" + spec: + host: "${APPLICATION_HOSTNAME}" + to: + kind: Service + name: "${APPLICATION_NAME}" + - kind: Service + apiVersion: v1 + metadata: + name: "${APPLICATION_NAME}" + labels: + app: "${APPLICATION_GROUP_NAME}" + application: "${APPLICATION_NAME}" + spec: + ports: + - name: "${APPLICATION_NAME}-http" + port: 8091 + targetPort: 8080 + selector: + deploymentconfig: "${APPLICATION_NAME}" + type: ClusterIP + sessionAffinity: None \ No newline at end of file diff --git a/templates/devonfw/devonfw-java-template.yaml b/templates/devonfw/devonfw-java-template.yaml new file mode 100644 index 0000000..ea65585 --- /dev/null +++ b/templates/devonfw/devonfw-java-template.yaml @@ -0,0 +1,190 @@ +kind: List +apiVersion: v1 +metadata: + name: s2i-devonfw +items: +- kind: Template + apiVersion: v1 + metadata: + name: devonfw-java + annotations: + description: DevonFW application (java/backend) + openshift.io/display-name: DevonFW Java + iconClass: devonfw-java-logo + tags: instant-app,devonfw,springboot,maven,java + labels: + createdBy: devonfw-java-server-template + parameters: + - description: 'The name for the application. It can''t contain whitespaces. It + should be the app name including technology, example: mythaistar-java' + name: APPLICATION_NAME + displayName: Application name + required: true + - description: 'The name for the group list of applications. It can''t contain whitespaces. + It should be the app name excluding technology, example: My-Thai-Star' + name: APPLICATION_GROUP_NAME + displayName: Application group name + required: true + - description: 'Custom hostname for service routes. Leave blank for default hostname, + e.g.: ..' + name: APPLICATION_HOSTNAME + displayName: Application hostname + - description: 'Git source URI for application, example: https://github.com/oasp/my-thai-star.git' + name: GIT_URI + displayName: Git repository URI + required: true + - description: 'Git branch/tag reference, example: develop' + name: GIT_REF + displayName: Git repository BRANCH + required: true + - description: 'Git directory context, example: /java/mtsj' + name: CONTEXT_DIR + displayName: Git repository CONTEXT + - description: Application options. These options will be passed to the Spring Boot + command line + name: APP_OPTIONS + - description: Github trigger secret + name: GITHUB_TRIGGER_SECRET + from: "[a-zA-Z0-9]{8}" + generate: expression + - description: Generic build trigger secret + name: GENERIC_TRIGGER_SECRET + from: "[a-zA-Z0-9]{8}" + generate: expression + objects: + - kind: BuildConfig + apiVersion: v1 + metadata: + name: "${APPLICATION_NAME}" + labels: + app: "${APPLICATION_GROUP_NAME}" + application: "${APPLICATION_NAME}" + spec: + triggers: + - type: GitHub + github: + secret: "${GITHUB_TRIGGER_SECRET}" + - type: Generic + generic: + secret: "${GENERIC_TRIGGER_SECRET}" + - type: ImageChange + imageChange: {} + source: + type: Git + git: + uri: "${GIT_URI}" + ref: "${GIT_REF}" + contextDir: "${CONTEXT_DIR}" + strategy: + type: Source + sourceStrategy: + from: + kind: ImageStreamTag + namespace: devonfw + name: s2i-devonfw-java:latest + env: + - name: MAVEN_GOALS + value: clean install package + - name: MAVEN_ARGS + value: "-DskipTests -B" + - name: MAVEN_OPTS + value: "-Xmx1024m -Xms1024m" + - name: MAVEN_PROFILE + value: '' + - name: MAVEN_MIRROR_URL + value: '' + - name: APP_SUFFIX + value: bootified + - name: ARTIFACT_DIR + value: server/target + output: + to: + kind: ImageStreamTag + name: "${APPLICATION_NAME}:latest" + resources: {} + - kind: ImageStream + apiVersion: v1 + metadata: + name: "${APPLICATION_NAME}" + labels: + app: "${APPLICATION_GROUP_NAME}" + application: "${APPLICATION_NAME}" + spec: + dockerImageRepository: '' + tags: + - name: latest + - kind: DeploymentConfig + apiVersion: v1 + metadata: + name: "${APPLICATION_NAME}" + labels: + app: "${APPLICATION_GROUP_NAME}" + application: "${APPLICATION_NAME}" + spec: + strategy: + type: Rolling + rollingParams: + updatePeriodSeconds: 1 + intervalSeconds: 1 + timeoutSeconds: 600 + resources: {} + triggers: + - type: ConfigChange + - type: ImageChange + imageChangeParams: + automatic: true + containerNames: + - "${APPLICATION_NAME}" + from: + kind: ImageStreamTag + name: "${APPLICATION_NAME}:latest" + replicas: 1 + selector: + deploymentconfig: "${APPLICATION_NAME}" + template: + metadata: + labels: + deploymentconfig: "${APPLICATION_NAME}" + spec: + containers: + - name: "${APPLICATION_NAME}" + image: "${APPLICATION_NAME}" + ports: + - containerPort: 8081 + protocol: TCP + resources: {} + terminationMessagePath: "/dev/termination-log" + imagePullPolicy: IfNotPresent + securityContext: + capabilities: {} + privileged: false + restartPolicy: Always + dnsPolicy: ClusterFirst + - kind: Route + apiVersion: v1 + metadata: + name: "${APPLICATION_NAME}" + labels: + app: "${APPLICATION_GROUP_NAME}" + application: "${APPLICATION_NAME}" + spec: + host: "${APPLICATION_HOSTNAME}" + to: + kind: Service + name: "${APPLICATION_NAME}" + - kind: Service + apiVersion: v1 + metadata: + name: "${APPLICATION_NAME}" + labels: + app: "${APPLICATION_GROUP_NAME}" + application: "${APPLICATION_NAME}" + spec: + ports: + - name: "${APPLICATION_NAME}-http" + port: 8081 + targetPort: 8081 + selector: + deploymentconfig: "${APPLICATION_NAME}" + type: ClusterIP + sessionAffinity: None From 89249761c0dfbe0c2260477ccd932e0f9946bb23 Mon Sep 17 00:00:00 2001 From: Dacal Cantos Date: Tue, 20 Feb 2018 10:01:47 +0100 Subject: [PATCH 3/4] add icon to languages --- .../devonfw/icons/devonfw-languagesIcon.png | Bin 0 -> 2752 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 templates/devonfw/icons/devonfw-languagesIcon.png diff --git a/templates/devonfw/icons/devonfw-languagesIcon.png b/templates/devonfw/icons/devonfw-languagesIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..13f7045f86434109584b6529aaa887a8d96c6ae0 GIT binary patch literal 2752 zcmV;x3P1IUP)(_`g8%^e{{R4h=>PzAFaQARU;qF*m;eA5Z<1fd zMgRZ`MoC0LRCwC#TWd^P=NW#!bB-^^HZ})4#yBws5+DgJ0g{e2H?}kxO-e3XH%%qI zsH-Mb+xnyG&rH*PY?D@LYPTOOT2EZ)W z_Tb>)8$RF7U;gn=uaT17KR#UW__MDnoVEY}kcf`WTs`^gK6(B&E@k8HxZS_NbY=RiH0}w zYpV|GM{isX4SQU2Jc>+5MhO=T1{duU1RD&r{Pt&xgzrX(r@HtrD@Juna zICd(O=#!n4LZh-4Zq6xxq<-Rhmp2x=&xK?N7(5st7K^22cseBObOGbH|#bQa>&hvauV`JmXf*{lZP^D?M zqp7LspX1}>2+f2w?8Mk=0W6zhoEkb)P3aTQz0&p3(Kay}p3DljOt2~MCtx%hHnu$cPZtEVS+P3y_0IO4tr2s42)|E4S&Nh;Wf0hlEX?R=;8X6lL ze?}>-UWv^>AP{J1Xb^AQ3gCw88t*MXzxF2P6VU^xq{3J_&`OFHJ0`Yi!J}tX; z?b=N#UB5z;fv&Eui_Oi=k+R1RGlkps9g-=m^mbTWoRm5(wfh=4hOFTjg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Sdq@?7c)9JM0&ZAcGcs$OstVby*ALltUG=$xf?!%e{ zh$n7&FV75gH0un;X|-B|tZ->S5QO{o-@0|n-PYFjvBhH9uGj1NWEdS781Qv<_QC59 zp!yfTFG_cRLy3ihp{@(>hy6nxYF-C5ugeOT4%}|{l6k1FukUk~W%I38Yd!#Yz21S7 zCr@@xM-zxkvO)H?cM!t#q_x%#_-}T9@qQCk Date: Wed, 5 Dec 2018 13:01:55 +0100 Subject: [PATCH 4/4] file to test CLA --- testCLA | 1 + 1 file changed, 1 insertion(+) create mode 100644 testCLA diff --git a/testCLA b/testCLA new file mode 100644 index 0000000..4aba98a --- /dev/null +++ b/testCLA @@ -0,0 +1 @@ +file for test CLA