-
Notifications
You must be signed in to change notification settings - Fork 33
/
manifest.jps
69 lines (60 loc) · 2.44 KB
/
manifest.jps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
type: install
version: 1.5
id: kubernetes
baseUrl: https://raw.githubusercontent.com/jelastic-jps/kubernetes/main
description:
text: /text/description-kube.md
short: Kubernetes cluster with automated scaling & cost efficient pay-per-use pricing for running cloud-native microservices.
categories:
- apps/clusters
- apps/dev-and-admin-tools
logo: /images/k8s-logo.png
name: Kubernetes Cluster
ssl: true
onBeforeInit: /scripts/beforeinit.js
onInstall:
- check-version
actions:
check-version:
- script: |
var baseUrl = "${baseUrl}".split("/"); baseUrl.pop(); baseUrl = baseUrl.join("/");
var url = baseUrl+"/${settings.version}/manifest.jps"
var huc = new java.net.URL(url).openConnection();
huc.setRequestMethod("HEAD");
var code = huc.getResponseCode();
if (code == 200){
return {result:0, onAfterReturn:{"install-cluster":{jps: url}}};
} else {
message = "The specified version ${settings.version} has no installation script!";
return {result:"", message: message};
}
install-cluster:
- params:
jps: ${this.jps}
envName: ${settings.envName}
displayName: ${settings.displayName}
envGroups: ${response.envGroups}
region: ${settings.region}
ownerUid: ${settings.ownerUid:[user.uid]}
settings: ${settings.toJSON()}
script: |
params = toNative(params);
params.envGroups = eval('(' + MANIFEST + ')').envGroups;
if (!params.ownerUid) delete params.ownerUid;
return api.marketplace.jps.Install(params);
- setGlobals:
success_text: ${response.successText}
- script: |
var resp = jelastic.env.control.GetEnvInfo('${settings.envName}', session);
if (resp.result != 0) return resp;
var protoName = resp.env.sslstate ? "https" : "http";
return {result: 0, onAfterReturn:{ setGlobals:{ start_page: protoName + "://" + resp.env.domain + "/" }}}
startPage: ${globals.start_page}
success:
email: false
text: |
${globals.success_text}
Try it yourself in a few minutes with our tutorials:
* [Deploy example of JakartaEE (CargoTracker) application](https://jelastic.com/blog/jakarta-ee-deployment-kubernetes/)
* [Configure CI/CD application delivery to K8s](https://jelastic.com/blog/kubernetes-gitlab-integration-testing/)
* [Bind custom domain to K8s application](https://jelastic.com/blog/kubernetes-public-ip-address/)