Merge branch 'main' of http://git.slaventius.ru/test3k/authDB
commit
eedb8c0ef5
18 changed files with 235 additions and 94 deletions
@ -1,5 +1,3 @@ |
|||||||
{ |
{ |
||||||
"recommendations": [ |
"recommendations": ["johnpapa.vscode-peacock"] |
||||||
"johnpapa.vscode-peacock" |
} |
||||||
] |
|
||||||
} |
|
||||||
|
@ -1,25 +1,25 @@ |
|||||||
{ |
{ |
||||||
"workbench.colorCustomizations": { |
"workbench.colorCustomizations": { |
||||||
"activityBar.activeBackground": "#0bba5d", |
"activityBar.activeBackground": "#0bba5d", |
||||||
"activityBar.activeBorder": "#eee1fd", |
"activityBar.activeBorder": "#eee1fd", |
||||||
"activityBar.background": "#0bba5d", |
"activityBar.background": "#0bba5d", |
||||||
"activityBarBadge.background": "#eee1fd", |
"activityBarBadge.background": "#eee1fd", |
||||||
"activityBarBadge.foreground": "#15202b", |
"activityBarBadge.foreground": "#15202b", |
||||||
"statusBar.background": "#088a45", |
"statusBar.background": "#088a45", |
||||||
"statusBarItem.hoverBackground": "#0bba5d", |
"statusBarItem.hoverBackground": "#0bba5d", |
||||||
"titleBar.activeBackground": "#088a45", |
"titleBar.activeBackground": "#088a45", |
||||||
"titleBar.inactiveBackground": "#088a4599", |
"titleBar.inactiveBackground": "#088a4599", |
||||||
"activityBar.foreground": "#e7e7e7", |
"activityBar.foreground": "#e7e7e7", |
||||||
"activityBar.inactiveForeground": "#e7e7e799", |
"activityBar.inactiveForeground": "#e7e7e799", |
||||||
"statusBar.foreground": "#e7e7e7", |
"statusBar.foreground": "#e7e7e7", |
||||||
"titleBar.activeForeground": "#e7e7e7", |
"titleBar.activeForeground": "#e7e7e7", |
||||||
"titleBar.inactiveForeground": "#e7e7e799", |
"titleBar.inactiveForeground": "#e7e7e799", |
||||||
"statusBarItem.remoteBackground": "#088a45", |
"statusBarItem.remoteBackground": "#088a45", |
||||||
"statusBarItem.remoteForeground": "#e7e7e7", |
"statusBarItem.remoteForeground": "#e7e7e7", |
||||||
"sash.hoverBorder": "#0bba5d", |
"sash.hoverBorder": "#0bba5d", |
||||||
"commandCenter.border": "#e7e7e799" |
"commandCenter.border": "#e7e7e799" |
||||||
}, |
}, |
||||||
"peacock.color": "#088a45", |
"peacock.color": "#088a45", |
||||||
"todo-tree.tree.disableCompactFolders": false, |
"todo-tree.tree.disableCompactFolders": false, |
||||||
"todo-tree.tree.showBadges": true |
"todo-tree.tree.showBadges": true |
||||||
} |
} |
||||||
|
@ -1,55 +1,70 @@ |
|||||||
{ |
{ |
||||||
// See https://go.microsoft.com/fwlink/?LinkId=733558 |
"version": "2.0.0", |
||||||
// for the documentation about the tasks.json format |
"tasks": [ |
||||||
"version": "2.0.0", |
{ |
||||||
"tasks": [ |
"label": "build", |
||||||
{ |
"type": "shell", |
||||||
"label": "build linux", |
"group": { |
||||||
"type": "shell", |
"kind": "build", |
||||||
"group": { |
"isDefault": true |
||||||
"kind": "build", |
}, |
||||||
"isDefault": true |
"presentation": { |
||||||
}, |
"echo": true, |
||||||
"presentation": { |
"panel": "new" |
||||||
"echo": true, |
}, |
||||||
"panel": "new" |
"options": { |
||||||
}, |
"cwd": "${workspaceRoot}", |
||||||
"options": { |
"env": { |
||||||
"cwd": "${workspaceRoot}", |
"APP": "authDBService", |
||||||
"env": { |
// "GOOS": "${env:GOOS}", |
||||||
"APP": "pakitara", |
// "GOARCH": "${env:GOARCH}", |
||||||
"GOOS": "linux", |
"GOOS": "linux", |
||||||
"GOARCH": "amd64", |
"GOARCH": "amd64", |
||||||
"GOBIN": "${env:GOPATH}/bin" |
"GOBIN": "${env:GOPATH}/bin" |
||||||
}, |
|
||||||
"args": [ |
|
||||||
"ldflags '-s -w'" |
|
||||||
] |
|
||||||
}, |
|
||||||
"command": "go build -o $GOBIN/$APP-$GOOS-$GOARCH -ldflags \"-s -w\" $APP.go", |
|
||||||
"problemMatcher": [] |
|
||||||
}, |
}, |
||||||
{ |
"args": ["ldflags '-s -w'"] |
||||||
"label": "build windows", |
}, |
||||||
"type": "shell", |
"command": "go build -o $GOBIN/$APP-$GOOS-$GOARCH -ldflags \"-s -w\" ./cmd/main.go", |
||||||
"group": "build", |
"problemMatcher": [] |
||||||
"presentation": { |
}, |
||||||
"echo": true, |
{ |
||||||
"panel": "new" |
"label": "docker-build", |
||||||
}, |
"type": "shell", |
||||||
"options": { |
"group": { |
||||||
"cwd": "${workspaceRoot}", |
"kind": "build" |
||||||
"env": { |
}, |
||||||
"APP": "pakitara", |
"presentation": { |
||||||
"GOOS": "windows", |
"echo": true, |
||||||
"GOARCH": "amd64", |
"panel": "new" |
||||||
"GOBIN": "${env:GOPATH}/bin" |
}, |
||||||
}, |
"options": { |
||||||
"args": [ |
"cwd": "${workspaceRoot}", |
||||||
"ldflags '-s -w'" |
"env": { |
||||||
] |
"TAG": "slaventius/test3k_auth_db:latest" |
||||||
}, |
}, |
||||||
"command": "go build -o $GOBIN\\$APP-$GOOS-$GOARCH.exe -ldflags \"-s -w\" $APP.go" |
"args": ["--no-cache", "--tag $TAG"] |
||||||
|
}, |
||||||
|
"command": "sudo docker build --no-cache --tag $TAG ./build/", |
||||||
|
"problemMatcher": [] |
||||||
|
}, |
||||||
|
{ |
||||||
|
"label": "docker-push", |
||||||
|
"type": "shell", |
||||||
|
"group": { |
||||||
|
"kind": "build" |
||||||
|
}, |
||||||
|
"presentation": { |
||||||
|
"echo": true, |
||||||
|
"panel": "new" |
||||||
|
}, |
||||||
|
"options": { |
||||||
|
"cwd": "${workspaceRoot}", |
||||||
|
"env": { |
||||||
|
"TAG": "slaventius/test3k_auth_db:latest" |
||||||
} |
} |
||||||
] |
}, |
||||||
} |
"command": "sudo docker push $TAG", |
||||||
|
"problemMatcher": [] |
||||||
|
} |
||||||
|
] |
||||||
|
} |
||||||
|
@ -1,5 +1 @@ |
|||||||
# authDB |
# authDB |
||||||
|
|
||||||
* http://git.slaventius.ru/test3k/authDB.git |
|
||||||
* docker build --no-cache --tag slaventius/test3k_auth_db:latest ./deploy/ |
|
||||||
* docker push slaventius/test3k_auth_db:latest |
|
@ -0,0 +1,25 @@ |
|||||||
|
.DEFAULT_GOAL := build
|
||||||
|
|
||||||
|
GOOS=$(shell go env GOOS)
|
||||||
|
GOARCH=$(shell go env GOARCH)
|
||||||
|
GOBIN=$(shell go env GOPATH)/bin
|
||||||
|
APP=authDBService
|
||||||
|
APP_BINARY=${GOBIN}/${APP}-${GOOS}-${GOARCH}
|
||||||
|
APP_TAG=slaventius/test3k_auth_db:latest
|
||||||
|
|
||||||
|
clean: |
||||||
|
@echo "cleaning ${APP_BINARY}"
|
||||||
|
@go clean
|
||||||
|
@rm -f ${APP_BINARY}
|
||||||
|
|
||||||
|
build: clean |
||||||
|
@echo "building ${APP_BINARY}"
|
||||||
|
@go build -o ${APP_BINARY} -ldflags "-s -w" ../cmd/main.go
|
||||||
|
|
||||||
|
docker-build: |
||||||
|
@echo "building docker-image ${APP_TAG}"
|
||||||
|
@sudo docker build --no-cache --tag ${APP_TAG} .
|
||||||
|
|
||||||
|
docker-push: docker-build |
||||||
|
@echo "pushing docker-image ${APP_TAG}"
|
||||||
|
@sudo docker push ${APP_TAG}
|
@ -0,0 +1,7 @@ |
|||||||
|
apiVersion: v1 |
||||||
|
kind: Secret |
||||||
|
metadata: |
||||||
|
name: auth-db-secret |
||||||
|
type: Opaque |
||||||
|
data: |
||||||
|
SENTRY_DSN: aHR0cHM6Ly8zZjRiMzFkYmJkOWE0YTZiOGE3MWY5ODgxZDk2MmYyNUBvNDUwNDY1NDU2OTc5OTY4MC5pbmdlc3Quc2VudHJ5LmlvLzQ1MDQ2NTQ1NzI2ODMyNjQ= |
@ -0,0 +1,6 @@ |
|||||||
|
apiVersion: v2 |
||||||
|
name: auth-db-HelmChart |
||||||
|
description: Helm Chart for auth-db |
||||||
|
type: application |
||||||
|
version: 0.1.0 |
||||||
|
appVersion: "1.0.0" |
@ -0,0 +1,8 @@ |
|||||||
|
apiVersion: v1 |
||||||
|
kind: ConfigMap |
||||||
|
metadata: |
||||||
|
name: {{ .Release.Name }}-config |
||||||
|
data: |
||||||
|
KAFKA_HOST: "37.143.12.169" |
||||||
|
KAFKA_PORT: "19092" |
||||||
|
APP_PORT: "9995" |
@ -0,0 +1,41 @@ |
|||||||
|
apiVersion: apps/v1 |
||||||
|
kind: Deployment |
||||||
|
metadata: |
||||||
|
name: {{ .Release.Name }}-application |
||||||
|
labels: |
||||||
|
app: {{ .Release.Name }}-application |
||||||
|
spec: |
||||||
|
replicas: 1 |
||||||
|
selector: |
||||||
|
matchLabels: |
||||||
|
app: {{ .Release.Name }}-application |
||||||
|
template: |
||||||
|
metadata: |
||||||
|
labels: |
||||||
|
app: {{ .Release.Name }}-application |
||||||
|
spec: |
||||||
|
containers: |
||||||
|
- name: {{ .Release.Name }}-application |
||||||
|
image: {{ .Values.container.image }} |
||||||
|
imagePullPolicy: Always |
||||||
|
ports: |
||||||
|
- containerPort: {{ .Values.container.port }} |
||||||
|
envFrom: |
||||||
|
- secretRef: |
||||||
|
name: {{ .Release.Name }}-secret |
||||||
|
- configMapRef: |
||||||
|
name: {{ .Release.Name }}-config |
||||||
|
# livenessProbe: |
||||||
|
# grpc: |
||||||
|
# port: {{ .Values.container.port }} |
||||||
|
# periodSeconds: 1 |
||||||
|
# initialDelaySeconds: 2 |
||||||
|
# failureThreshold: 3 |
||||||
|
# successThreshold: 1 |
||||||
|
# readinessProbe: |
||||||
|
# grpc: |
||||||
|
# port: {{ .Values.container.port }} |
||||||
|
# periodSeconds: 1 |
||||||
|
# initialDelaySeconds: 4 |
||||||
|
# failureThreshold: 3 |
||||||
|
# successThreshold: 1 |
@ -0,0 +1,7 @@ |
|||||||
|
apiVersion: v1 |
||||||
|
kind: Secret |
||||||
|
metadata: |
||||||
|
name: {{ .Release.Name }}-secret |
||||||
|
type: Opaque |
||||||
|
data: |
||||||
|
SENTRY_DSN: aHR0cHM6Ly8zZjRiMzFkYmJkOWE0YTZiOGE3MWY5ODgxZDk2MmYyNUBvNDUwNDY1NDU2OTc5OTY4MC5pbmdlc3Quc2VudHJ5LmlvLzQ1MDQ2NTQ1NzI2ODMyNjQ= |
@ -0,0 +1,14 @@ |
|||||||
|
apiVersion: v1 |
||||||
|
kind: Service |
||||||
|
metadata: |
||||||
|
name: {{ .Release.Name }}-service |
||||||
|
labels: |
||||||
|
app: {{ .Release.Name }}-application |
||||||
|
spec: |
||||||
|
type: ClusterIP |
||||||
|
selector: |
||||||
|
app: {{ .Release.Name }}-application |
||||||
|
ports: |
||||||
|
- protocol: TCP |
||||||
|
port: {{ .Values.container.port }} |
||||||
|
targetPort: {{ .Values.container.port }} |
@ -0,0 +1,3 @@ |
|||||||
|
container: |
||||||
|
image: slaventius/test3k_auth_db:latest |
||||||
|
port: 9995 |
@ -1,9 +1,13 @@ |
|||||||
#!/bin/sh |
#!/bin/sh |
||||||
|
|
||||||
export APP_PORT=9995 |
export APP_PORT=9995 |
||||||
# export KAFKA_PORT=9092 |
|
||||||
export KAFKA_PORT=19092 |
export KAFKA_PORT=19092 |
||||||
export KAFKA_HOST=127.0.0.1 |
export KAFKA_HOST=37.143.12.169 |
||||||
# export KAFKA_HOST=37.143.12.169 |
export SENTRY_DSN="https://3f4b31dbbd9a4a6b8a71f9881d962f25@o4504654569799680.ingest.sentry.io/4504654572683264" |
||||||
|
|
||||||
./authDBService |
export APP=authDBService |
||||||
|
export GOOS=$(eval go env GOOS) |
||||||
|
export GOARCH=$(eval go env GOARCH) |
||||||
|
export GOBIN=$(eval go env GOPATH)/bin |
||||||
|
|
||||||
|
${GOBIN}/${APP}-${GOOS}-${GOARCH} |
Loading…
Reference in new issue