Added CI resources
This commit is contained in:
parent
9b48f2ee50
commit
619a99a6dd
15
Dockerfile
Normal file
15
Dockerfile
Normal file
@ -0,0 +1,15 @@
|
||||
FROM golang:1.19-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY [ "go.mod", "go.sum", "./" ]
|
||||
|
||||
RUN go mod download
|
||||
|
||||
COPY "datasources" "./datasources/"
|
||||
COPY "utils" "./utils/"
|
||||
COPY *.go ./
|
||||
|
||||
RUN go build -o /golifehkbot
|
||||
|
||||
CMD [ "/golifehkbot" ]
|
24
concourse/build.yaml
Normal file
24
concourse/build.yaml
Normal file
@ -0,0 +1,24 @@
|
||||
platform: linux
|
||||
|
||||
image_resource:
|
||||
type: registry-image
|
||||
source:
|
||||
repository: concourse/oci-build-task
|
||||
|
||||
inputs:
|
||||
- name: project-src
|
||||
path: .
|
||||
|
||||
outputs:
|
||||
- name: image
|
||||
|
||||
caches:
|
||||
- path: cache
|
||||
|
||||
params:
|
||||
CONTEXT: .
|
||||
# Reference: https://concourse-ci.org/building-an-image-and-using-it-in-a-task.html#build-the-image
|
||||
UNPACK_ROOTFS: true
|
||||
|
||||
run:
|
||||
path: build
|
21
concourse/prepare-deployment-resources.yaml
Normal file
21
concourse/prepare-deployment-resources.yaml
Normal file
@ -0,0 +1,21 @@
|
||||
platform: linux
|
||||
|
||||
image_resource:
|
||||
type: registry-image
|
||||
source:
|
||||
repository: alpine
|
||||
|
||||
inputs:
|
||||
- name: project-src
|
||||
path: .
|
||||
|
||||
outputs:
|
||||
- name: deploy-confs
|
||||
|
||||
run:
|
||||
path: sh
|
||||
args:
|
||||
- -exc
|
||||
- |
|
||||
VERSION=$( cat commit.sha )
|
||||
sed "s/IMAGE_TAG/$VERSION/g" k8s/deployments.yaml >> deploy-confs/prod.yaml
|
26
k8s/deployments.yaml
Normal file
26
k8s/deployments.yaml
Normal file
@ -0,0 +1,26 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: golifehk
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: golifehk
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: golifehk
|
||||
srv: go
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: registry-auth
|
||||
containers:
|
||||
- name: app
|
||||
image: registry.k8s.astropenguin.net/golifehk:IMAGE_TAG
|
||||
env:
|
||||
- name: TELEGRAM_API_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: golifehk-conf
|
||||
key: TELEGRAM_API_TOKEN
|
Loading…
Reference in New Issue
Block a user