Compare commits
37 Commits
169fbf9bc6
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| a6ecdb1d46 | |||
| 72592e97b2 | |||
| 2df1862cdd | |||
| c0c61a71c2 | |||
| 3489bd14fc | |||
| cb09f8818d | |||
| 57958bd383 | |||
| 3abd4c1519 | |||
| 67ac0b03a5 | |||
| c3824dc377 | |||
| a6d44cf54a | |||
| b7f30d3436 | |||
| ccd503b0e7 | |||
| 4dd5054000 | |||
| 989a491429 | |||
| 1b8d1d0725 | |||
| 1d9e4c71d3 | |||
| 23f8755c95 | |||
| c24b9e4cdc | |||
| 2733d4f567 | |||
| 7cc5c91dce | |||
| a4cb903627 | |||
| 9849cb8b19 | |||
| 08f13cc088 | |||
| d1d51d2bef | |||
| 44589c69e2 | |||
| b046d9f250 | |||
| c730ee5717 | |||
| 68f41fb16e | |||
| b26c1729ec | |||
| 8090ba597b | |||
| 4f29c7a212 | |||
| 6f0d80576a | |||
| 42694115bd | |||
| a870a370c9 | |||
| ff2030cc49 | |||
| 737905e195 |
54
.drone.yml
54
.drone.yml
@@ -1,30 +1,60 @@
|
||||
---
|
||||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: test
|
||||
image: golang
|
||||
- name: test
|
||||
image: golang:1.24
|
||||
commands:
|
||||
- pwd
|
||||
- go test -v
|
||||
- go build
|
||||
- echo "hello" > /shared/greetings.txt
|
||||
- hostname >> /shared/greetings.txt
|
||||
volumes:
|
||||
- name: shared
|
||||
path: /shared
|
||||
resources:
|
||||
limits:
|
||||
cpu: 1
|
||||
memory: 200MiB
|
||||
cpu: 1000
|
||||
memory: 512MiB
|
||||
requests:
|
||||
cpu: 1
|
||||
memory: 50MiB
|
||||
cpu: 500
|
||||
memory: 200MiB
|
||||
|
||||
- name: docker
|
||||
#image: plugins/docker
|
||||
image: banzaicloud/drone-kaniko
|
||||
- name: read
|
||||
pull: if-not-exists
|
||||
image: alpine
|
||||
volumes:
|
||||
- name: shared
|
||||
path: /shared
|
||||
commands:
|
||||
- pwd
|
||||
- ls /shared
|
||||
- cat /shared/greetings.txt
|
||||
|
||||
- name: docker
|
||||
image: harbor.ntppool.org/ntppool/drone-kaniko:main
|
||||
pull: always
|
||||
settings:
|
||||
repo: drone-test/drone-test
|
||||
repo: ask/drone-test
|
||||
registry: harbor.ntppool.org
|
||||
tags: latest,${DRONE_COMMIT_SHA}
|
||||
#auto_tag: true
|
||||
auto_tag: true
|
||||
tags: SHA7,${DRONE_SOURCE_BRANCH}
|
||||
cache: true
|
||||
username:
|
||||
from_secret: harbor_username
|
||||
password:
|
||||
from_secret: harbor_password
|
||||
|
||||
volumes:
|
||||
- name: shared
|
||||
claim:
|
||||
name: go-pkg
|
||||
|
||||
---
|
||||
kind: signature
|
||||
hmac: 2b21527432d95cf52636c65e091d9129c198299a425d12b2860d468262234d62
|
||||
|
||||
...
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
FROM golang:1.14.3 as builder
|
||||
FROM golang:1.24-alpine3.21 as builder
|
||||
WORKDIR /go/src/gitea.develooper.com/ask/drone-test
|
||||
ADD . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o demo
|
||||
RUN CGO_ENABLED=1 GOOS=linux go build -o demo
|
||||
|
||||
FROM alpine:3.21 as production
|
||||
|
||||
USER root
|
||||
|
||||
FROM alpine:3.11 as production
|
||||
COPY --from=builder /go/src/gitea.develooper.com/ask/drone-test/demo .
|
||||
CMD ["./demo"]
|
||||
|
||||
Reference in New Issue
Block a user