Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
7f38e567d9 | |||
57958bd383 | |||
3abd4c1519 | |||
67ac0b03a5 | |||
c3824dc377 | |||
a6d44cf54a | |||
b7f30d3436 | |||
ccd503b0e7 | |||
4dd5054000 | |||
989a491429 | |||
1b8d1d0725 | |||
1d9e4c71d3 | |||
23f8755c95 | |||
c24b9e4cdc | |||
2733d4f567 | |||
7cc5c91dce |
91
.drone.yml
91
.drone.yml
@@ -1,30 +1,73 @@
|
||||
---
|
||||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: test
|
||||
image: golang:1.14.3
|
||||
commands:
|
||||
- go test -v
|
||||
- go build
|
||||
resources:
|
||||
limits:
|
||||
cpu: 1000
|
||||
memory: 300MiB
|
||||
requests:
|
||||
cpu: 500
|
||||
memory: 200MiB
|
||||
- name: test
|
||||
image: golang:1.20.4
|
||||
commands:
|
||||
- pwd
|
||||
- go test -v
|
||||
- go build
|
||||
- echo "hello" > /shared/greetings.txt
|
||||
- hostname >> /shared/greetings.txt
|
||||
volumes:
|
||||
- name: shared
|
||||
path: /shared
|
||||
resources:
|
||||
limits:
|
||||
cpu: 1000
|
||||
memory: 300MiB
|
||||
requests:
|
||||
cpu: 500
|
||||
memory: 200MiB
|
||||
|
||||
- name: docker
|
||||
image: askbjoernhansen/drone-kaniko:0.22-6
|
||||
settings:
|
||||
repo: drone-builds/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
|
||||
- name: download
|
||||
image: fedora:38
|
||||
commands:
|
||||
- ls; pwd
|
||||
- ./scripts/download-release test/187 dist/
|
||||
resources:
|
||||
requests:
|
||||
cpu: 250
|
||||
memory: 64MiB
|
||||
limits:
|
||||
cpu: 250
|
||||
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
|
||||
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 .
|
||||
CMD ["./demo"]
|
||||
|
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