Skip to content

Commit 268cc59

Browse files
committed
whoops
Signed-off-by: Sarah Christoff <28318173+schristoff@users.noreply.github.com>
1 parent d64977e commit 268cc59

File tree

10 files changed

+299
-0
lines changed

10 files changed

+299
-0
lines changed
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Dockerfile
2+
.cnab
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
install() {
5+
mkdir -p /cnab/app/outputs
6+
echo "topsecret" >> /cnab/app/outputs/mysql-root-password
7+
echo "moresekrets" >> /cnab/app/outputs/mysql-password
8+
}
9+
10+
ping() {
11+
echo ping
12+
}
13+
14+
# Call the requested function and pass the arguments as-is
15+
"$@"
+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
schemaVersion: 1.0.1
2+
name: mysql
3+
version: 0.1.4
4+
registry: "localhost:5000"
5+
6+
mixins:
7+
- exec
8+
- helm3:
9+
repositories:
10+
bitnami:
11+
url: "https://charts.bitnami.com/bitnami"
12+
13+
credentials:
14+
- name: kubeconfig
15+
path: /home/nonroot/.kube/config
16+
17+
parameters:
18+
- name: database-name
19+
type: string
20+
default: mydb
21+
env: DATABASE_NAME
22+
- name: mysql-user
23+
type: string
24+
default: mysql-admin
25+
env: MYSQL_USER
26+
- name: namespace
27+
type: string
28+
default: 'mysql'
29+
- name: mysql-name
30+
type: string
31+
default: porter-ci-mysql
32+
- name: probe-timeout
33+
description: Timeout for liveness and readiness probes
34+
type: integer
35+
default: 1
36+
37+
install:
38+
- exec:
39+
command: ./helpers.sh
40+
arguments:
41+
- install
42+
43+
ping:
44+
- exec:
45+
description: "Ping"
46+
command: ./helpers.sh
47+
arguments:
48+
- ping
49+
50+
upgrade:
51+
- exec:
52+
command: ./helpers.sh
53+
arguments:
54+
- install
55+
56+
uninstall:
57+
- exec:
58+
command: echo
59+
arguments:
60+
- uninstall mysql
61+
62+
outputs:
63+
- name: mysql-password
64+
description: "The mysql database password"
65+
type: string
66+
default: "default-password"
67+
applyTo:
68+
- install
69+
- upgrade
70+
sensitive: true
71+
path: /cnab/app/outputs/mysql-password
72+
- name: mysql-root-password
73+
description: "The mysql root user password"
74+
default: "default-root-password"
75+
type: string
76+
applyTo:
77+
- install
78+
- upgrade
79+
sensitive: true
80+
path: /cnab/app/outputs/mysql-root-password
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Dockerfile
2+
.cnab
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
install() {
5+
mkdir -p /cnab/app/outputs
6+
echo "topsecret-blog" >> /cnab/app/outputs/wordpress-password
7+
}
8+
9+
ping() {
10+
echo ping
11+
}
12+
13+
# Call the requested function and pass the arguments as-is
14+
"$@"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
schemaVersion: 1.0.1
2+
name: wordpress
3+
version: 0.1.4
4+
registry: "localhost:5000"
5+
6+
mixins:
7+
- exec
8+
- helm3:
9+
repositories:
10+
bitnami:
11+
url: "https://charts.bitnami.com/bitnami"
12+
13+
dependencies:
14+
requires:
15+
- name: mysql
16+
bundle:
17+
reference: localhost:5000/mysql:v0.1.4
18+
parameters:
19+
database-name: wordpress
20+
mysql-user: wordpress
21+
namespace: wordpress
22+
23+
credentials:
24+
- name: kubeconfig
25+
path: /home/nonroot/.kube/config
26+
27+
parameters:
28+
- name: wordpress-name
29+
type: string
30+
default: porter-ci-wordpress
31+
env: WORDPRESS_NAME
32+
- name: wordpress-password
33+
type: string
34+
sensitive: true
35+
applyTo:
36+
- install
37+
- upgrade
38+
- name: namespace
39+
type: string
40+
default: 'wordpress'
41+
42+
install:
43+
- exec:
44+
command: ./helpers.sh
45+
arguments:
46+
- install
47+
48+
upgrade:
49+
- exec:
50+
command: ./helpers.sh
51+
arguments:
52+
- install
53+
54+
ping:
55+
- exec:
56+
description: "Ping"
57+
command: ./helpers.sh
58+
arguments:
59+
- ping
60+
61+
uninstall:
62+
- exec:
63+
command: echo
64+
arguments:
65+
- uninstalled
66+
67+
outputs:
68+
- name: wordpress-password
69+
description: "The Wordpress installation password"
70+
type: string
71+
default: "default-password"
72+
applyTo:
73+
- "install"
74+
- "upgrade"
75+
sensitive: true
76+
path: /cnab/app/outputs/wordpress-password
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
install() {
5+
mkdir -p /cnab/app/outputs
6+
echo "topsecret-blog" >> /cnab/app/outputs/wordpress-password
7+
}
8+
9+
ping() {
10+
echo ping
11+
}
12+
13+
# Call the requested function and pass the arguments as-is
14+
"$@"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
schemaVersion: 1.1.0
2+
name: wordpress
3+
version: 0.1.4
4+
registry: "localhost:5000"
5+
6+
mixins:
7+
- exec
8+
- helm3:
9+
repositories:
10+
bitnami:
11+
url: "https://charts.bitnami.com/bitnami"
12+
13+
dependencies:
14+
requires:
15+
- name: mysql
16+
bundle:
17+
reference: localhost:5000/mysql:v0.1.4
18+
sharing:
19+
mode: true
20+
group:
21+
name: myapp
22+
parameters:
23+
database-name: wordpress
24+
mysql-user: wordpress
25+
namespace: wordpress
26+
27+
credentials:
28+
- name: kubeconfig
29+
path: /home/nonroot/.kube/config
30+
31+
parameters:
32+
- name: wordpress-name
33+
type: string
34+
default: porter-ci-wordpress
35+
env: WORDPRESS_NAME
36+
- name: wordpress-password
37+
type: string
38+
sensitive: true
39+
applyTo:
40+
- install
41+
- upgrade
42+
- name: namespace
43+
type: string
44+
default: 'wordpress'
45+
46+
install:
47+
- exec:
48+
command: ./helpers.sh
49+
arguments:
50+
- install
51+
52+
upgrade:
53+
- exec:
54+
command: ./helpers.sh
55+
arguments:
56+
- install
57+
58+
ping:
59+
- exec:
60+
description: "Ping"
61+
command: ./helpers.sh
62+
arguments:
63+
- ping
64+
65+
uninstall:
66+
- exec:
67+
command: echo
68+
arguments:
69+
- uninstall wordpress
70+
71+
outputs:
72+
- name: wordpress-password
73+
description: "The Wordpress installation password"
74+
type: string
75+
default: "default-password"
76+
applyTo:
77+
- "install"
78+
- "upgrade"
79+
sensitive: true
80+
path: /cnab/app/outputs/wordpress-password

build/testdata/credentials/ci.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "ci",
3+
"credentials": [
4+
{
5+
"name": "kubeconfig",
6+
"source": {
7+
"path": "KUBECONFIGPATH"
8+
}
9+
}
10+
]
11+
}

build/testdata/schema.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"installations": "1.0.0",
3+
"credentials": "1.0.0",
4+
"parameters": "1.0.0"
5+
}

0 commit comments

Comments
 (0)