Compare commits

...

2 Commits

Author SHA1 Message Date
Eg
78719a6bb1 commit ci file
Some checks reported errors
continuous-integration/drone/push Build was killed
2022-06-15 10:58:05 +08:00
Eg
37090ccdc6 commit ci file 2022-06-15 10:57:59 +08:00
2 changed files with 14 additions and 33 deletions

View File

@ -10,12 +10,12 @@ steps:
- name: BuildToRegistry - name: BuildToRegistry
image: plugins/docker image: plugins/docker
settings: settings:
registry: registry.cn-hangzhou.aliyuncs.com registry: registry.cn-shanghai.aliyuncs.com
repo: registry.cn-hangzhou.aliyuncs.com/hyxc_dev/scale_manager repo: registry.cn-shanghai.aliyuncs.com/docker-echo
username: username:
from_secret: registry_username from_secret: xs765911
password: password:
from_secret: registry_password from_secret: loser7659
use_cache: true use_cache: true
# event为push且分支为master的时候自动打latest为tag则会根据tag自动生成 # event为push且分支为master的时候自动打latest为tag则会根据tag自动生成
tag: tag:
@ -24,32 +24,3 @@ steps:
when: when:
status: status:
- "success" - "success"
---
kind: pipeline
type: docker
name: BuildProd
trigger:
event: [tag]
steps:
- name: BuildToRegistry
image: plugins/docker
# depends_on:
# - CheckCode
settings:
registry: registry.cn-hangzhou.aliyuncs.com
repo: registry.cn-hangzhou.aliyuncs.com/hyxc/scale_manager
username:
from_secret: registry_username
password:
from_secret: registry_password
use_cache: true
# event为push且分支为master的时候自动打latest为tag则会根据tag自动生成
auto_tag: true
when:
status:
- "success"

10
Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM golang:1.18 as builder
WORKDIR /build
COPY . .
RUN CGO_ENABLED=0 GOPROXY=https://proxy.golang.com.cn,direct go build -o demo
FROM alpine:3.10 as runner
LABEL description="the image is a demo"
WORKDIR /app
COPY --from=builder /build/demo /app/
EXPOSE 8080
ENTRYPOINT ["./demo"]