Compare commits
34 Commits
ffcf6f372d
...
curl-test
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f38e567d9 | |||
| 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 | |||
| 169fbf9bc6 | |||
| 445d041eae |
91
.drone.yml
91
.drone.yml
@@ -1,30 +1,73 @@
|
|||||||
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: kubernetes
|
type: kubernetes
|
||||||
name: default
|
name: default
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: test
|
- name: test
|
||||||
image: golang
|
image: golang:1.20.4
|
||||||
commands:
|
commands:
|
||||||
- go test -v
|
- pwd
|
||||||
- go build
|
- go test -v
|
||||||
resources:
|
- go build
|
||||||
limits:
|
- echo "hello" > /shared/greetings.txt
|
||||||
cpu: 1
|
- hostname >> /shared/greetings.txt
|
||||||
memory: 100MiB
|
volumes:
|
||||||
requests:
|
- name: shared
|
||||||
cpu: 1
|
path: /shared
|
||||||
memory: 50MiB
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 1000
|
||||||
|
memory: 300MiB
|
||||||
|
requests:
|
||||||
|
cpu: 500
|
||||||
|
memory: 200MiB
|
||||||
|
|
||||||
- name: docker
|
- name: download
|
||||||
#image: plugins/docker
|
image: fedora:38
|
||||||
image: banzaicloud/drone-kaniko
|
commands:
|
||||||
settings:
|
- ls; pwd
|
||||||
repo: drone-test/drone-test
|
- ./scripts/download-release test/187 dist/
|
||||||
registry: harbor.ntppool.org
|
resources:
|
||||||
tags: latest,${DRONE_COMMIT_SHA}
|
requests:
|
||||||
#auto_tag: true
|
cpu: 250
|
||||||
username:
|
memory: 64MiB
|
||||||
from_secret: harbor_username
|
limits:
|
||||||
password:
|
cpu: 250
|
||||||
from_secret: harbor_password
|
memory: 256MiB
|
||||||
|
|
||||||
|
- 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: ask/drone-test
|
||||||
|
registry: harbor.ntppool.org
|
||||||
|
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: 94513b436eb1b0ef9f1d1b0f128328f23bb343f1b9d9d6e7a0e80dacc22d3c48
|
||||||
|
|
||||||
|
...
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
FROM golang:1.14.3 as builder
|
FROM golang:1.16.4-alpine3.13 as builder
|
||||||
WORKDIR /go/src/gitea.develooper.com/ask/drone-test
|
WORKDIR /go/src/gitea.develooper.com/ask/drone-test
|
||||||
ADD . .
|
ADD . .
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -o demo
|
RUN CGO_ENABLED=1 GOOS=linux go build -o demo
|
||||||
|
|
||||||
FROM alpine:3.11 as production
|
FROM alpine:3.13 as production
|
||||||
COPY --from=builder /go/src/gitea.develooper.com/ask/drone-test/demo .
|
COPY --from=builder /go/src/gitea.develooper.com/ask/drone-test/demo .
|
||||||
CMD ["./demo"]
|
CMD ["./demo"]
|
||||||
|
|||||||
7
main_test.go
Normal file
7
main_test.go
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
func TestMain(t *testing.T) {
|
||||||
|
t.Log("it's all okay")
|
||||||
|
}
|
||||||
30
scripts/download-release
Executable file
30
scripts/download-release
Executable file
@@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
BUILD=$1
|
||||||
|
DIR=$2
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [ -z "$DIR" ]; then
|
||||||
|
echo run with $0 BUILD_NUMBER DIR
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p $DIR
|
||||||
|
|
||||||
|
BASE=https://geodns.bitnames.com/monitor/builds/$BUILD
|
||||||
|
|
||||||
|
files=`curl -sSf $BASE/checksums.txt | awk '{print $2}'`
|
||||||
|
metafiles="checksums.txt metadata.json CHANGELOG.md artifacts.json"
|
||||||
|
|
||||||
|
for f in $metafiles; do
|
||||||
|
url=$BASE/$f
|
||||||
|
echo downloading $url
|
||||||
|
curl --remove-on-error -sSfRo $DIR/$f $url || true
|
||||||
|
done
|
||||||
|
|
||||||
|
for f in $files; do
|
||||||
|
url=$BASE/$f
|
||||||
|
echo downloading $url
|
||||||
|
curl --remove-on-error -sSfRo $DIR/$f $url
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user