Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6b6ca36737 | |||
| bd0ffbe2c2 | |||
| 67507b81f0 | |||
| dcb432c572 | |||
| 51e9830876 |
@ -8,4 +8,4 @@ steps:
|
||||
SEELF_API_KEY:
|
||||
from_secret: seelf_api_key
|
||||
commands:
|
||||
- /bin/sh -c 'curl -X POST -H "Content-Type:application/json" -H "Authorization:Bearer $SEELF_API_KEY" -d "{\"environment\":\"staging\",\"git\":{\"branch\":\"$DRONE_BRANCH\",\"hash\":\"$DRONE_COMMIT\"}}" https://seelf.voixdunet.com/api/v1/apps/2P5woMQ7sPQQMktVRl08wfJL6b5/deployments'
|
||||
- /bin/sh -c 'curl -X POST -H "Content-Type:application/json" -H "Authorization:Bearer $SEELF_API_KEY" -d "{\"environment\":\"staging\",\"git\":{\"branch\":\"$DRONE_BRANCH\",\"hash\":\"$DRONE_COMMIT\"}}" https://seelf.voixdunet.com/api/v1/apps/2PvP5liIhcMn59yo5q6m53QWWXM/deployments'
|
||||
|
||||
@ -13,6 +13,8 @@ services:
|
||||
image: postgres:14-alpine
|
||||
volumes:
|
||||
- dbdata:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5432:5432/tcp"
|
||||
environment:
|
||||
- POSTGRES_USER=app
|
||||
- POSTGRES_PASSWORD=apppa55word
|
||||
|
||||
12
main.go
12
main.go
@ -14,7 +14,7 @@ func main() {
|
||||
dsn := os.Getenv("DSN")
|
||||
|
||||
if dsn == "" {
|
||||
panic("db connection string should be set with the DSN env variable!!")
|
||||
panic("db connection string should be set with the DSN env variable!")
|
||||
}
|
||||
|
||||
db, err := sql.Open("postgres", dsn)
|
||||
@ -64,8 +64,9 @@ INSERT INTO runs(date) VALUES (now());
|
||||
}
|
||||
|
||||
ctx.JSON(http.StatusOK, response{
|
||||
Env: os.Environ(),
|
||||
Runs: results,
|
||||
Description: "Simple application which logs in a database the date of each run and exposes environment variables to test seelf.",
|
||||
Env: os.Environ(),
|
||||
Runs: results,
|
||||
})
|
||||
})
|
||||
|
||||
@ -80,6 +81,7 @@ type data struct {
|
||||
}
|
||||
|
||||
type response struct {
|
||||
Env []string `json:"env"`
|
||||
Runs []data `json:"runs"`
|
||||
Description string `json:"description"`
|
||||
Env []string `json:"env"`
|
||||
Runs []data `json:"runs"`
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user