Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

test CLA sign #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
47 changes: 47 additions & 0 deletions s2i/angular/s2i-devonfw-angular-imagestream.yaml
Original file line number Diff line number Diff line change
@@ -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'
46 changes: 46 additions & 0 deletions s2i/java/s2i-devonfw-java-imagestream.yaml
Original file line number Diff line number Diff line change
@@ -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'
2 changes: 1 addition & 1 deletion templates/devonfw/devonfw-angular-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
189 changes: 189 additions & 0 deletions templates/devonfw/devonfw-angular-template.yaml
Original file line number Diff line number Diff line change
@@ -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.: <application-name>.<project>.<default-domain-suffix>'
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
2 changes: 1 addition & 1 deletion templates/devonfw/devonfw-java-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading