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
89 lines (75 loc) · 2.16 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
name: "External MongoDB Database"
description: "Creates an Acorn service to connect to an external MongoDB database."
readme: "./README.md"
info: localData.info
services: mongo: {
generated: job: "create"
default: true
}
jobs: create: {
image: "alpine"
env: {
"secret://config": ""
}
dirs: {
"/acorn/scripts": "./scripts"
}
entrypoint: ["/acorn/scripts/render.sh"]
}
secrets: user: {
type: "generated"
params: job: "create"
}
secrets: admin: {
type: "generated"
params: job: "create"
}
secrets: config: {
type: "credential.acorn.io/mongodb"
params: {
instructions: localData.instructions
promptOrder: ["proto", "address", "port", "dbName", "adminUsername", "adminPassword", "username", "password"]
}
data: {
address: ""
port: "27017"
username: ""
password: ""
adminUsername: ""
adminPassword: ""
proto: "mongodb+srv"
dbName: ""
}
}
localData: instructions: """
## Overview
This will create the service from an existing MongoDB so that it can be swapped with the MongoDB container service.
## Instructions
fill in:
- address: the address of the MongoDB server (mongo.example.com)
- port: the port of the MongoDB server (27017)
- username: the username to use to connect to the MongoDB server
- password: the password to use to connect to the MongoDB server
- adminUsername: the username to use to connect to the MongoDB server as an admin
- adminPassword: the password to use to connect to the MongoDB server as an admin
- proto: the protocol to use to connect to the MongoDB server (mongodb or mongodb+srv)
- dbName: the name of the database to use
"""
localData: info: """
## Usage
services: db: {
image: "ghcr.io/acorn-io/mongodb-external:v#.#.#"
}
containers: app: {
image: "app-image"
env: {
DB_HOST: "@{@{service.}db.address}"
DB_PORT: "@{@{service.}db.port.27017}"
DB_NAME: "@{@{service.}db.data.dbName}"
DB_USER: "@{@{service.}db.secrets.user.username}"
DB_PASS: "@{@{service.}db.secrets.user.password}"
DB_ADMIN_USER: "@{@{service.}db.secrets.admin.username}"
DB_ADMIN_PASS: "@{@{service.}db.secrets.admin.password}"
}
}
"""