forked from kabanero-io/codewind-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
404 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# | ||
# Copyright (c) 2018-2019 Red Hat, Inc. | ||
# This program and the accompanying materials are made | ||
# available under the terms of the Eclipse Public License 2.0 | ||
# which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
FROM mikefarah/yq as builder | ||
RUN apk add --no-cache bash | ||
|
||
#COPY .htaccess README.md *.sh /build/ | ||
COPY *.sh /build/ | ||
COPY /devfiles /build/devfiles | ||
WORKDIR /build/ | ||
RUN ./check_mandatory_fields.sh devfiles | ||
CMD ["sh","-c", "./index.sh > /build/devfiles/index.json"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
# codewind-templates | ||
Central repository for storing list of supported code templates for use in codewind | ||
|
||
# /devfiles/index.json | ||
This file is generated and MUST NOT be manually edited. | ||
|
||
1. Run [build.sh](https://github.com/microclimate-dev2ops/codewind-templates/blob/master/build.sh) to build the dockerfile. | ||
2. Run the dockerfile mounting a local directory | ||
```sh | ||
docker run -v /myDirectory/codewind-templates/devfiles:/build/devfiles/ microclimate-dev2ops/codewind-templates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright (c) 2012-2018 Red Hat, Inc. | ||
# This program and the accompanying materials are made | ||
# available under the terms of the Eclipse Public License 2.0 | ||
# which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
|
||
docker build -t microclimate-dev2ops/codewind-templates:latest . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (c) 2018-2019 Red Hat, Inc. | ||
# This program and the accompanying materials are made | ||
# available under the terms of the Eclipse Public License 2.0 | ||
# which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
|
||
set -e | ||
|
||
FIELDS=('displayName' 'description' 'projectType') | ||
|
||
|
||
|
||
# check that field value, given in the parameter, is not null or empty | ||
function check_field() { | ||
if [[ $1 == "null" || $1 = "" ]];then | ||
return 1; | ||
fi | ||
return 0 | ||
} | ||
|
||
readarray -d '' arr < <(find "$1" -name 'meta.yaml' -print0) | ||
|
||
for i in "${arr[@]}" | ||
do | ||
id=$(yq r "$i" displayName | sed 's/^"\(.*\)"$/\1/') | ||
full_id=${id}:${i} | ||
|
||
echo "Checking devfile '${i}'" | ||
|
||
unset NULL_OR_EMPTY_FIELDS | ||
|
||
for FIELD in "${FIELDS[@]}" | ||
do | ||
VALUE=$(yq r "$i" "$FIELD") | ||
|
||
if ! check_field "${VALUE}";then | ||
NULL_OR_EMPTY_FIELDS+="$FIELD " | ||
fi | ||
done | ||
|
||
if [[ -n "${NULL_OR_EMPTY_FIELDS}" ]];then | ||
echo "!!! Null or empty mandatory fields in '${full_id}': $NULL_OR_EMPTY_FIELDS" | ||
INVALID_FIELDS=true | ||
fi | ||
done | ||
|
||
if [[ -n "${INVALID_FIELDS}" ]];then | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
specVersion: 0.0.1 | ||
name: jgoTemplate | ||
projects: | ||
- source: | ||
type: git | ||
location: "https://github.com/microclimate-dev2ops/microclimateGoTemplate" | ||
components: | ||
- alias: codewind-plugin | ||
type: chePlugin | ||
id: <server>/plugins/codewind/codewind-plugin/0.0.1 | ||
- alias: codewind-theia | ||
type: chePlugin | ||
id: <server>/plugins/codewind/codewind-theia/0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
displayName: Go template | ||
description: Sample microservice for simple go app | ||
tags: ["go", "docker"] | ||
globalMemoryLimit: 2674Mi | ||
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg | ||
projectType: "docker" | ||
language: "go" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
[ | ||
{ | ||
"displayName":"Java MicroProfile template", | ||
"description":"Cloud Microservice Starter for Java - MicroProfile / Java EE", | ||
"language":"java", | ||
"projectType":"liberty", | ||
"location":"https://github.com/microclimate-dev2ops/javaMicroProfileTemplate", | ||
"links": {"self":"/devfiles/javaMicroProfileTemplate/devfile.yaml" } | ||
} | ||
,{ | ||
"displayName":"Spring template", | ||
"description":"Template for building a Spring microservice", | ||
"language":"java", | ||
"projectType":"spring", | ||
"location":"https://github.com/microclimate-dev2ops/springJavaTemplate", | ||
"links": {"self":"/devfiles/springJavaTemplate/devfile.yaml" } | ||
} | ||
,{ | ||
"displayName":"Python template", | ||
"description":"HelloWorld microservice written in python", | ||
"language":"python", | ||
"projectType":"docker", | ||
"location":"https://github.com/microclimate-dev2ops/SVTPythonTemplate", | ||
"links": {"self":"/devfiles/pythonTemplate/devfile.yaml" } | ||
} | ||
,{ | ||
"displayName":"Node.js template", | ||
"description":"Cloud-ready Node.js Express sample application", | ||
"language":"nodejs", | ||
"projectType":"nodejs", | ||
"location":"https://github.com/microclimate-dev2ops/nodeExpressTemplate", | ||
"links": {"self":"/devfiles/nodeExpressTemplate/devfile.yaml" } | ||
} | ||
,{ | ||
"displayName":"Swift microcservice template", | ||
"description":"Template for building a Swift microservice", | ||
"language":"swift", | ||
"projectType":"swift", | ||
"location":"https://github.com/microclimate-dev2ops/swiftTemplate", | ||
"links": {"self":"/devfiles/swiftTemplate/devfile.yaml" } | ||
} | ||
,{ | ||
"displayName":"Go template", | ||
"description":"Sample microservice for simple go app", | ||
"language":"go", | ||
"projectType":"docker", | ||
"location":"https://github.com/microclimate-dev2ops/microclimateGoTemplate", | ||
"links": {"self":"/devfiles/goTemplate/devfile.yaml" } | ||
} | ||
,{ | ||
"displayName":"Java Lagom template", | ||
"description":"Template for building Lagom Reactive microservice in Java", | ||
"language":"java", | ||
"projectType":"docker", | ||
"location":"https://github.com/microclimate-dev2ops/lagomJavaTemplate", | ||
"links": {"self":"/devfiles/lagomJavaTemplate/devfile.yaml" } | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
specVersion: 0.0.1 | ||
name: javaMicroProfileTemplate | ||
projects: | ||
- source: | ||
type: git | ||
language: java | ||
location: "https://github.com/microclimate-dev2ops/javaMicroProfileTemplate" | ||
components: | ||
- alias: codewind-plugin | ||
type: chePlugin | ||
id: <server>/plugins/codewind/codewind-plugin/0.0.1 | ||
- alias: codewind-theia | ||
type: chePlugin | ||
id: <server>/plugins/codewind/codewind-theia/0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
displayName: Java MicroProfile template | ||
description: Cloud Microservice Starter for Java - MicroProfile / Java EE | ||
tags: ["Java", "Maven",] | ||
globalMemoryLimit: 2674Mi | ||
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg | ||
projectType: "liberty" | ||
language: "java" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
specVersion: 0.0.1 | ||
name: lagomJavaTemplate | ||
projects: | ||
- source: | ||
type: git | ||
language: java | ||
location: "https://github.com/microclimate-dev2ops/lagomJavaTemplate" | ||
components: | ||
- alias: codewind-plugin | ||
type: chePlugin | ||
id: <server>/plugins/codewind/codewind-plugin/0.0.1 | ||
- alias: codewind-theia | ||
type: chePlugin | ||
id: <server>/plugins/codewind/codewind-theia/0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
displayName: Java Lagom template | ||
description: Template for building Lagom Reactive microservice in Java | ||
tags: ["Java", "Maven",] | ||
globalMemoryLimit: 2674Mi | ||
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg | ||
projectType: "docker" | ||
language: "java" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
specVersion: 0.0.1 | ||
name: nodeExpressTemplate | ||
projects: | ||
- source: | ||
type: git | ||
language: nodejs | ||
location: "https://github.com/microclimate-dev2ops/nodeExpressTemplate" | ||
components: | ||
- alias: codewind-plugin | ||
type: chePlugin | ||
id: <server>/plugins/codewind/codewind-plugin/0.0.1 | ||
- alias: codewind-theia | ||
type: chePlugin | ||
id: <server>/plugins/codewind/codewind-theia/0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
displayName: Node.js template | ||
description: Cloud-ready Node.js Express sample application | ||
tags: ["Nodejs"] | ||
globalMemoryLimit: 2674Mi | ||
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg | ||
projectType: "nodejs" | ||
language: "nodejs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
specVersion: 0.0.1 | ||
name: Python Template | ||
projects: | ||
- source: | ||
type: git | ||
language: python | ||
location: "https://github.com/microclimate-dev2ops/SVTPythonTemplate" | ||
components: | ||
- alias: codewind-plugin | ||
type: chePlugin | ||
id: <server>/plugins/codewind/codewind-plugin/0.0.1 | ||
- alias: codewind-theia | ||
type: chePlugin | ||
id: <server>/plugins/codewind/codewind-theia/0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
displayName: Python template | ||
description: HelloWorld microservice written in python | ||
tags: ["python", "docker"] | ||
globalMemoryLimit: 2674Mi | ||
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg | ||
projectType: "docker" | ||
language: "python" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
specVersion: 0.0.1 | ||
name: springJavaTemplate | ||
projects: | ||
- source: | ||
type: git | ||
location: "https://github.com/microclimate-dev2ops/springJavaTemplate" | ||
components: | ||
- alias: codewind-plugin | ||
type: chePlugin | ||
id: <server>/plugins/codewind/codewind-plugin/0.0.1 | ||
- alias: codewind-theia | ||
type: chePlugin | ||
id: <server>/plugins/codewind/codewind-theia/0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
displayName: Spring template | ||
description: Template for building a Spring microservice | ||
tags: ["Java", "Spring",] | ||
globalMemoryLimit: 2674Mi | ||
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg | ||
projectType: "spring" | ||
language: "java" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
specVersion: 0.0.1 | ||
name: swiftTemplate | ||
projects: | ||
- source: | ||
type: git | ||
location: "https://github.com/microclimate-dev2ops/swiftTemplate" | ||
components: | ||
- alias: codewind-plugin | ||
type: chePlugin | ||
id: <server>/plugins/codewind/codewind-plugin/0.0.1 | ||
- alias: codewind-theia | ||
type: chePlugin | ||
id: <server>/plugins/codewind/codewind-theia/0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
displayName: Swift microcservice template | ||
description: Template for building a Swift microservice | ||
tags: ["swift"] | ||
globalMemoryLimit: 2674Mi | ||
projectType: "swift" | ||
language: "swift" |
Oops, something went wrong.