This repository has been archived by the owner on Mar 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Acornfile
91 lines (78 loc) · 2.11 KB
/
Acornfile
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: "External MySQL Server"
description: "Create an Acorn service to connect to an external MySQL server."
readme: "./README.md"
info: localData.info
services: mysql: {
generated: job: "create"
default: true
}
jobs: create: {
image: "alpine"
env: {
"secret://config": ""
}
dirs: {
"/acorn/scripts": "./scripts"
}
entrypoint: ["/acorn/scripts/render.sh"]
}
secrets: admin: {
type: "generated"
params: job: "create"
}
secrets: user: {
type: "generated"
params: job: "create"
}
secrets: config: {
type: "credential.acorn.io/mysql"
params: {
instructions: localData.instructions
promptOrder: ["proto", "address", "port", "adminUsername", "adminPassword", "username", "password", "dbName"]
}
data: {
address: ""
port: "3306"
adminUsername: ""
adminPassword: ""
username: ""
password: ""
proto: ""
dbName: ""
}
}
localData: instructions: """
## Overview
This will create the service from an existing MySQL server.
## Instructions
fill in:
- address: the address of the MySQL server endpoint (mysql.example.com)
- port: the port of the MySQL server (3306)
- adminUsername: the main username to use to connect to the MySQL server as an admin
- adminPassword: the main password to use to connect to the MySQL server as an admin
- username: the username to use to connect to the MySQL server db Instance
- password: the password to use to connect to the MySQL server db Instance
- proto: the protocol to use to connect to the MySQL server.
- dbName: the name of the database to use
"""
localData: info: """
## Usage
```aml
services: db: {
external: "@{acorn.name}"
}
containers: app: {
image: "app-image"
consumes: ["db"]
env: {
DB_HOST: "@{@{service.}db.address}"
DB_PORT: "@{@{service.}db.port.3306}"
DB_NAME: "@{@{service.}db.data.dbName}"
DB_ADMIN_USER: "@{@{service.}db.secrets.admin.username}"
DB_ADMIN_PASS: "@{@{service.}db.secrets.admin.password}"
DB_USER: "@{@{service.}db.secrets.user.username}"
DB_PASS: "@{@{service.}db.secrets.user.password}"
}
}
```
"""