Skip to content

Commit 70299f1

Browse files
author
simonrempel
committed
Initial commit
0 parents  commit 70299f1

File tree

15 files changed

+834
-0
lines changed

15 files changed

+834
-0
lines changed

.air.conf

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# .air.conf
2+
# Config file for [Air](https://github.com/cosmtrek/air) in TOML format
3+
4+
# Working directory
5+
# . or absolute path, please note that the directories following must be under root.
6+
root = "."
7+
tmp_dir = "tmp"
8+
9+
[build]
10+
# Just plain old shell command. You could use `make` as well.
11+
cmd = "go build -o ./tmp/main ."
12+
# Binary file yields from `cmd`.
13+
bin = "tmp/main"
14+
# Customize binary.
15+
full_bin = "APP_ENV=dev APP_USER=air ./tmp/main"
16+
# Watch these filename extensions.
17+
include_ext = ["go", "tpl", "tmpl", "html"]
18+
# Ignore these filename extensions or directories.
19+
exclude_dir = ["assets", "tmp", "vendor", "frontend/node_modules"]
20+
# Watch these directories if you specified.
21+
include_dir = []
22+
# Exclude files.
23+
exclude_file = []
24+
# It's not necessary to trigger build each time file changes if it's too frequent.
25+
delay = 1000 # ms
26+
# Stop to run old binary when build errors occur.
27+
stop_on_error = true
28+
# This log file places in your tmp_dir.
29+
log = "air_errors.log"
30+
31+
[log]
32+
# Show log time
33+
time = false
34+
35+
[color]
36+
# Customize each part's color. If no color found, use the raw app log.
37+
main = "magenta"
38+
watcher = "cyan"
39+
build = "yellow"
40+
runner = "green"
41+
42+
[misc]
43+
# Delete tmp directory on exit
44+
clean_on_exit = true

.drone.yml

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
kind: pipeline
2+
type: docker
3+
name: amd64
4+
5+
platform:
6+
arch: amd64
7+
8+
steps:
9+
- name: build and publish
10+
image: plugins/docker
11+
settings:
12+
registry: registry.dev.onetask.ai
13+
username:
14+
from_secret: docker_username
15+
password:
16+
from_secret: docker_password
17+
repo: "registry.dev.onetask.ai/${DRONE_REPO}"
18+
tags: ["${DRONE_COMMIT_SHA}", "${DRONE_COMMIT_BRANCH}"]
19+
cache_from:
20+
- "registry.dev.onetask.ai/${DRONE_REPO}:dev"
21+
- "registry.dev.onetask.ai/${DRONE_REPO}:${DRONE_COMMIT_BRANCH}"
22+
- name: trigger update
23+
image: appleboy/drone-ssh
24+
settings:
25+
host: app.dev.onetask.ai
26+
username:
27+
from_secret: ssh_user
28+
key:
29+
from_secret: ssh_key
30+
ssh_passphrase:
31+
from_secret: ssh_passphrase
32+
script:
33+
- /bin/sh ./trigger_dev_deployment.sh
34+
35+
trigger:
36+
event:
37+
- push
38+
39+
---
40+
kind: pipeline
41+
type: docker
42+
name: arm64
43+
44+
platform:
45+
arch: arm64
46+
47+
steps:
48+
- name: build and publish
49+
image: plugins/docker
50+
settings:
51+
registry: registry.dev.onetask.ai
52+
username:
53+
from_secret: docker_username
54+
password:
55+
from_secret: docker_password
56+
repo: "registry.dev.onetask.ai/${DRONE_REPO}"
57+
tags: ["${DRONE_COMMIT_SHA}_arm64", "${DRONE_COMMIT_BRANCH}_arm64"]
58+
cache_from:
59+
- "registry.dev.onetask.ai/${DRONE_REPO}:dev_arm64"
60+
- "registry.dev.onetask.ai/${DRONE_REPO}:${DRONE_COMMIT_BRANCH}_arm64"
61+
62+
trigger:
63+
branch:
64+
- dev
65+
- beta-v2
66+
event:
67+
- push
68+
69+
---
70+
kind: pipeline
71+
type: docker
72+
name: amd64-dockerhub
73+
74+
platform:
75+
arch: amd64
76+
77+
steps:
78+
- name: build and publish
79+
image: plugins/docker
80+
settings:
81+
username:
82+
from_secret: dockerhub_username
83+
password:
84+
from_secret: dockerhub_password
85+
repo: "kernai/${DRONE_REPO_NAME}"
86+
tag: "${DRONE_TAG}-drone-amd64"
87+
88+
trigger:
89+
event:
90+
- tag
91+
92+
---
93+
kind: pipeline
94+
type: docker
95+
name: arm64-dockerhub
96+
97+
platform:
98+
arch: arm64
99+
100+
steps:
101+
- name: build and publish
102+
image: plugins/docker
103+
settings:
104+
username:
105+
from_secret: dockerhub_username
106+
password:
107+
from_secret: dockerhub_password
108+
repo: "kernai/${DRONE_REPO_NAME}"
109+
tag: "${DRONE_TAG}-drone-arm64"
110+
111+
trigger:
112+
event:
113+
- tag
114+
115+
---
116+
kind: pipeline
117+
name: manifest-version
118+
steps:
119+
- name: manifest
120+
image: plugins/manifest
121+
settings:
122+
spec: drone-manifest-version.tmpl
123+
tag: "${DRONE_TAG}"
124+
ignore_missing: true
125+
username:
126+
from_secret: dockerhub_username
127+
password:
128+
from_secret: dockerhub_password
129+
130+
depends_on:
131+
- amd64-dockerhub
132+
- arm64-dockerhub
133+
134+
trigger:
135+
event:
136+
- tag
137+
138+
---
139+
kind: pipeline
140+
name: manifest-latest
141+
steps:
142+
- name: manifest
143+
image: plugins/manifest
144+
settings:
145+
spec: drone-manifest-latest.tmpl
146+
tag: "${DRONE_TAG}"
147+
ignore_missing: true
148+
username:
149+
from_secret: dockerhub_username
150+
password:
151+
from_secret: dockerhub_password
152+
153+
depends_on:
154+
- manifest-version
155+
156+
trigger:
157+
event:
158+
- tag

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
*.out
13+
14+
# Dependency directories (remove the comment below to include it)
15+
# vendor/
16+
17+
tmp
18+

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM golang:1.16-alpine
2+
3+
WORKDIR /app
4+
5+
COPY go.mod ./
6+
COPY go.sum ./
7+
RUN go mod download
8+
9+
COPY *.go ./
10+
11+
RUN go build -o /refinery-websocket
12+
13+
EXPOSE 8080
14+
15+
CMD [ "/refinery-websocket" ]

0 commit comments

Comments
 (0)