-
Notifications
You must be signed in to change notification settings - Fork 1
/
.drone.yml
128 lines (128 loc) · 4.68 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
---
{
"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":
[
"npm install elm-analyse elm-format",
"npx elm-analyse",
"npx elm-format --validate src/",
],
"image": "node:lts-buster",
"name": "Elm lint",
"pull": "always",
},
{
"environment": { "DOCKER_BUILDKIT": 1 },
"image": "plugins/docker",
"name": "Build container image",
"pull": "always",
"settings": { "dry_run": true, "purge": true, "repo": "build-only" },
"trigger": { "event": ["pull_request"] },
"when": { "branch": { "exclude": ["master"] } },
},
{
"environment":
{
"HUGIN_MAPBOX_ACCESS_TOKEN":
{ "from_secret": "hugin_mapbox_access_token" },
"HUGIN_ROLLBAR_ACCESS_TOKEN":
{ "from_secret": "hugin_rollbar_access_token" },
"HUGIN_SENTRY_DSN": { "from_secret": "hugin_sentry_dsn" },
},
"image": "plugins/docker",
"name": "Publish image kradalby/hugin",
"pull": "always",
"settings":
{
"build_args_from_env":
[
"HUGIN_MAPBOX_ACCESS_TOKEN",
"HUGIN_ROLLBAR_ACCESS_TOKEN",
"HUGIN_SENTRY_DSN",
],
"password": { "from_secret": "docker_password" },
"purge": true,
"repo": "kradalby/hugin",
"tags":
[
"latest",
"latest-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}",
"${DRONE_COMMIT_SHA:0:8}",
],
"username": { "from_secret": "docker_username" },
},
"when": { "branch": ["master", "main"], "event": ["push"] },
},
{
"commands":
[
'container-file-extractor "kradalby/hugin" "${DRONE_COMMIT_SHA:0:8}" "usr/share/nginx/html"',
"mkdir -p dist/",
"mv output/usr/share/nginx/html/* dist/.",
],
"image": "kradalby/container-file-extractor:latest",
"name": "Extract from container",
"pull": "always",
"when": { "branch": ["master", "main"], "event": ["push"] },
},
{
"image": "drillster/drone-rsync",
"name": "Deploy with rsync",
"pull": "always",
"settings":
{
"args": "--delete --omit-dir-times --no-perms",
"exclude":
[
"content",
"munin.json",
"50x.html",
"people.json",
"legacy_people.json",
],
"hosts": ["core.terra.fap.no"],
"include": [],
"key": { "from_secret": "ssh_key" },
"source": ["dist/"],
"target": "/fastest/serve/hugin/",
"user": "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",
}