archetype-resources.quickstart-template.json Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cdi-camel-jetty-archetype
Show all versions of cdi-camel-jetty-archetype
Creates a new Camel route using CDI in a standalone Java Container using Jetty as HTTP server
#set( $H = '##' )
#set( $D = '$' )
{
"apiVersion": "v1",
"kind": "Template",
"labels": {},
"metadata": {
"annotations": {
"description": "# CDI Camel Jetty QuickStart\n\nThis example shows how to work with Camel in the Java Container using CDI to configure components,\nendpoints and beans.\n\nThis quickstart is the server side which embeds a Jetty HTTP server in a Camel route that\nexposes a HTTP service.\n\nThe `quickstart-cdi-camel-http` is the client to this quickstart that can be started which will call this\nJetty HTTP server every 5 second.\n\n\n${H}# Building\n\nThe example can be built with\n\n mvn clean install\n\n\n${H}# Running the example locally\n\nThe example can be run locally using the following Maven goal:\n\n mvn clean install exec:java\n\nAnd you can access the HTTP service using a web browser on url:\n\n http://localhost:8080/camel/hello\n\n\n${H}# Running the example in fabric8\n\nIt is assumed a running Kubernetes platform is already running. If not you can find details how to [get started](http://fabric8.io/guide/getStarted/index.html).\n\nThe example can be built and deployed using a single goal:\n\n mvn -Pf8-local-deploy\n\nWhen the example runs in fabric8, you can use the OpenShift client tool to inspect the status\n\nTo list all the running pods:\n\n oc get pods\n\nThen find the name of the pod that runs this quickstart, and output the logs from the running pods with:\n\n oc logs \n\nThe example exposes a service over HTTP which you can find using\n\n oc get routes\n\nThis lists all the routes to the services, where you can find the actual HTTP url, which you can use from a web browser.\n\nThe Camel route is listening on context-path `camel/hello`, so the actual HTTP url should be prefixed with that.\nFor example if the route to the service is listed at `http://qs-cdi-camel-jetty.vagrant.f8` then the actual URL to use should be `http://qs-cdi-camel-jetty.vagrant.f8/camel/hello`\n\nYou can also use the fabric8 [web console](http://fabric8.io/guide/console.html) to manage the\nrunning pods, and view logs and much more.\n\n\n${H} Calling the HTTP service from a shell script\n\nYou can also call the remote HTTP service from a shell script. We have provided a script named `src/test/resources/hitme-f8.sh` (no script for windows)\nin the source code for the quickstart, not in the docker image, which will call the service once per second.\n\nYou may need to add execution permission to the script before you can execute it\n\n chmod +x src/test/resources/hitme-f8.sh\n\nAnd then run the script\n\n src/test/resources/hitme-f8.sh\n\nWhile the script runs, you can try to scale up or down the number of pods on the Jetty HTTP service using either the fabric8 web console,\nor from the command line using the openshift client\n\n oc scale --replicas=3 replicationcontrollers quickstart-cdi-camel-jetty\n\n\n${H}# More details\n\nYou can find more details about running this [quickstart](http://fabric8.io/guide/quickstarts/running.html) on the website. This also includes instructions how to change the Docker image user and registry.\n\n",
"iconClass": "icon-java"
},
"labels": {},
"name": "s2i-quickstart-cdi-camel-jetty"
},
"parameters": [
{
"name": "APP_NAME",
"value": "s2i-quickstart-cdi-camel-jetty",
"description": "Application Name"
},
{
"name": "GIT_REPO",
"required": true,
"description": "Git repository, required"
},
{
"name": "GIT_REF",
"value": "master",
"description": "Git ref to build"
},
{
"name": "SERVICE_NAME",
"value": "s2i-qs-cdi-camel-jetty",
"description": "Exposed Service name"
},
{
"name": "BUILDER_VERSION",
"value": "1.2.5",
"description": "Builder version"
},
{
"name": "APP_VERSION",
"value": "2.2.64-SNAPSHOT",
"description": "Application version"
},
{
"name": "MAVEN_ARGS",
"value": "package -DskipTests -e",
"description": "Arguments passed to mvn in the build"
},
{
"name": "MAVEN_ARGS_APPEND",
"description": "Extra arguments passed to mvn, e.g. for multi-module builds"
},
{
"name": "ARTIFACT_DIR",
"description": "Maven build directory"
},
{
"generate": "expression",
"name": "BUILD_SECRET",
"description": "The secret needed to trigger a build",
"from": "[a-zA-Z0-9]{8}"
}
],
"objects": [
{
"apiVersion": "v1",
"kind": "Route",
"metadata": {
"labels": {
"container": "java",
"component": "${D}{APP_NAME}",
"provider": "s2i",
"project": "${D}{APP_NAME}",
"version": "${D}{APP_VERSION}",
"group": "quickstarts"
},
"name": "${D}{SERVICE_NAME}-route"
},
"spec": {
"to": {
"kind": "Service",
"name": "${D}{SERVICE_NAME}"
}
}
},
{
"apiVersion": "v1",
"kind": "Service",
"metadata": {
"annotations": {
"prometheus.io/port": "9779",
"prometheus.io/scrape": "true"
},
"labels": {
"container": "java",
"component": "${D}{APP_NAME}",
"provider": "s2i",
"project": "${D}{APP_NAME}",
"version": "${D}{APP_VERSION}",
"group": "quickstarts"
},
"name": "${D}{SERVICE_NAME}"
},
"spec": {
"deprecatedPublicIPs": [],
"ports": [
{
"port": 9102,
"protocol": "TCP",
"targetPort": 8080
}
],
"selector": {
"container": "java",
"project": "${D}{APP_NAME}",
"component": "${D}{APP_NAME}",
"provider": "s2i",
"group": "quickstarts"
}
}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "s2i-java-${D}{APP_NAME}",
"creationTimestamp": null,
"labels": {
"component": "${D}{APP_NAME}",
"container": "java",
"group": "quickstarts",
"project": "${D}{APP_NAME}",
"provider": "s2i",
"version": "${D}{APP_VERSION}"
}
},
"spec": {
"dockerImageRepository": "fabric8/s2i-java:${D}{BUILDER_VERSION}"
},
"status": {
"dockerImageRepository": ""
}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "${D}{APP_NAME}",
"creationTimestamp": null,
"labels": {
"component": "${D}{APP_NAME}",
"container": "java",
"group": "quickstarts",
"project": "${D}{APP_NAME}",
"provider": "s2i",
"version": "${D}{APP_VERSION}"
}
},
"spec": {},
"status": {
"dockerImageRepository": ""
}
},
{
"kind": "BuildConfig",
"apiVersion": "v1",
"metadata": {
"name": "${D}{APP_NAME}",
"creationTimestamp": null,
"labels": {
"component": "${D}{APP_NAME}",
"container": "java",
"group": "quickstarts",
"project": "${D}{APP_NAME}",
"provider": "s2i",
"version": "${D}{APP_VERSION}"
}
},
"spec": {
"triggers": [
{
"type": "GitHub",
"github": {
"secret": "${D}{BUILD_SECRET}"
}
},
{
"type": "Generic",
"generic": {
"secret": "${D}{BUILD_SECRET}"
}
},
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChange": {}
}
],
"source": {
"type": "Git",
"git": {
"uri": "${D}{GIT_REPO}",
"ref": "${D}{GIT_REF}"
}
},
"strategy": {
"type": "Source",
"sourceStrategy": {
"from": {
"kind": "ImageStreamTag",
"name": "s2i-java-${D}{APP_NAME}:${D}{BUILDER_VERSION}"
},
"forcePull": true,
"env": [
{
"name": "BUILD_LOGLEVEL",
"value": "5"
},
{
"name": "ARTIFACT_DIR",
"value": "${D}{ARTIFACT_DIR}"
},
{
"name": "MAVEN_ARGS",
"value": "${D}{MAVEN_ARGS}"
},
{
"name": "MAVEN_ARGS_APPEND",
"value": "${D}{MAVEN_ARGS_APPEND}"
}
]
}
},
"output": {
"to": {
"kind": "ImageStreamTag",
"name": "${D}{APP_NAME}:latest"
}
},
"resources": {}
},
"status": {
"lastVersion": 0
}
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "${D}{APP_NAME}",
"creationTimestamp": null,
"labels": {
"component": "${D}{APP_NAME}",
"container": "java",
"group": "quickstarts",
"project": "${D}{APP_NAME}",
"provider": "s2i",
"version": "${D}{APP_VERSION}"
}
},
"spec": {
"strategy": {
"resources": {}
},
"triggers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"${D}{APP_NAME}"
],
"from": {
"kind": "ImageStreamTag",
"name": "${D}{APP_NAME}:latest"
}
}
}
],
"replicas": 1,
"selector": {
"component": "${D}{APP_NAME}",
"container": "java",
"deploymentconfig": "${D}{APP_NAME}",
"group": "quickstarts",
"project": "${D}{APP_NAME}",
"provider": "s2i",
"version": "${D}{APP_VERSION}"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"component": "${D}{APP_NAME}",
"container": "java",
"deploymentconfig": "${D}{APP_NAME}",
"group": "quickstarts",
"project": "${D}{APP_NAME}",
"provider": "s2i",
"version": "${D}{APP_VERSION}"
}
},
"spec": {
"containers": [
{
"name": "${D}{APP_NAME}",
"image": "library/${D}{APP_NAME}:latest",
"readinessProbe": {
"exec": {
"command": [
"/bin/bash",
"-c",
"(curl -f 127.0.0.1:8080) >/dev/null 2>&1; test $? != 7"
]
},
"initialDelaySeconds": 30,
"timeoutSeconds": 5
},
"ports": [
{
"containerPort": 8080,
"name": "http"
},
{
"containerPort": 8778,
"name": "jolokia"
}
],
"resources": {}
}
]
}
}
},
"status": {}
}
]
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy