/
.drone.yml
71 lines (71 loc) · 2.73 KB
/
.drone.yml
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
---
{
"kind": "pipeline",
"name": "Kubernetes",
"node_selector": { "drone": true },
"platform": { "arch": "amd64", "os": "linux" },
"steps":
[
{
"commands":
[
"npm install prettier",
"echo .pre-commit-config.yaml >> .prettierignore",
'npx prettier --check "**/*.{ts,js,md,yaml,yml,sass,css,scss,html,htm}"',
],
"image": "node:lts-buster",
"name": "Prettier lint",
"pull": "always",
},
{
"commands": ["go test ./..."],
"image": "golang:1.16-buster",
"name": "Go test",
"pull": "always",
},
{
"commands":
[
"go get github.com/mitchellh/gox",
'gox -osarch "!darwin/386" -output="dist/{{.Dir}}_{{.OS}}_{{.Arch}}"',
],
"image": "golang:1.16-buster",
"name": "Go build",
"pull": "always",
},
{
"environment": { "SSH_KEY": { "from_secret": "ssh_key" } },
"image": "appleboy/drone-scp",
"name": "Deploy with scp",
"pull": "always",
"settings":
{
"host": "core.terra.fap.no",
"rm": true,
"source": ["dist/*"],
"strip_components": 1,
"target": "/fastest/serve/builds/kubespace",
"username": "deploy",
},
"when": { "branch": ["master", "main"], "event": ["push"] },
},
{
"image": "appleboy/drone-discord",
"name": "Notify Discord",
"pull": "always",
"settings":
{
"message": "{{#success build.status}}\n✅ Build #{{build.number}} of `{{repo.name}}` succeeded.\n\n📝 Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit.message}} ```\n🌐 {{ build.link }}\n\n✅ duration: {{duration build.started build.finished}}\n✅ started: {{datetime build.started \"2006/01/02 15:04\" \"UTC\"}}\n✅ finished: {{datetime build.finished \"2006/01/02 15:04\" \"UTC\"}}\n\n{{else}}\n@everyone\n❌ Build #{{build.number}} of `{{repo.name}}` failed.\n\n📝 Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit.message}} ```\n🌐 {{ build.link }}\n\n✅ duration: {{duration build.started build.finished}}\n✅ started: {{datetime build.started \"2006/01/02 15:04\" \"UTC\"}}\n✅ finished: {{datetime build.finished \"2006/01/02 15:04\" \"UTC\"}}\n\n{{/success}}\n",
"webhook_id": { "from_secret": "discord_webhook_id" },
"webhook_token": { "from_secret": "discord_webhook_token" },
},
"when":
{
"branch": ["master", "main"],
"event": ["push"],
"status": ["success", "failure"],
},
},
],
"type": "kubernetes",
}