Compare commits

..

5 Commits

Author SHA1 Message Date
6b6ca36737 Actualiser docker-compose.yml
All checks were successful
continuous-integration/drone/push Build is passing
2024-05-16 23:42:19 +02:00
bd0ffbe2c2 Mise à jour de 'docker-compose.yml'
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
2023-06-09 23:22:09 +02:00
67507b81f0 Mise à jour de 'main.go'
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-17 22:03:49 +02:00
dcb432c572 Mise à jour de '.drone.yml'
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-17 16:44:13 +02:00
51e9830876 Test
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-12 19:05:35 +02:00
3 changed files with 10 additions and 6 deletions

View File

@ -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'

View File

@ -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
View File

@ -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"`
}