qwq
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-06-10 10:31:49 +09:00
parent 6f77188fd1
commit 18033355b9
2 changed files with 18 additions and 33 deletions

View File

@ -2,29 +2,7 @@ kind: pipeline
type: docker
name: 构建 Goose
workspace:
path: /drone/src
steps:
- name: 构建 Goose 二进制包
image: golang:latest
environment:
USERNAME:
from_secret: USERNAME
PASSWORD:
from_secret: API_KEY
volumes:
- name: place-goose
path: /place-goose
commands:
- git clone https://github.com/pressly/goose.git
- cd goose
- go build -tags='no_mysql no_ydb no_vertica no_mssql no_libsql no_sqlite3 no_clickhouse' -o goose ./cmd/goose
- mv goose ../goose-bin
- cd ..
- curl --user $USERNAME:$PASSWORD --upload-file ./goose-bin https://gitea.service.jazzwhom.top/api/packages/kagami-public/generic/goose/$DRONE_BUILD_NUMBER/goose
- mv ./goose-bin /place-goose/goose
- name: 构建 Goose Docker 包
image: docker:latest
privileged: true
@ -39,11 +17,8 @@ steps:
volumes:
- name: docker-socket
path: /var/run/docker.sock
- name: place-goose
path: /place-goose
commands:
- mv /place-goose/goose /drone/src/goose-bin
- echo "$PASSWORD" | docker login -u "$USERNAME" --password-stdin "$DOCKER_REGISTRY"
- docker build -t "$DOCKER_REGISTRY/$DOCKER_ORGANIZATION/$DOCKER_APPLICATION:$DRONE_BUILD_NUMBER" .
- docker build -t "$DOCKER_REGISTRY/$DOCKER_ORGANIZATION/$DOCKER_APPLICATION:latest" .
@ -54,5 +29,3 @@ volumes:
- name: docker-socket
host:
path: /var/run/docker.sock
- name: place-goose
temp: {}

View File

@ -1,5 +1,17 @@
FROM scratch
COPY goose-bin /goose
WORKDIR /
RUN chmod +x /goose
ENTRYPOINT ["/goose"]
FROM alpine:3.19 AS downloader
WORKDIR /app
ARG GOOSE_VERSION="v3.24.3"
ARG GOOSE_ARCH="linux_x86_64"
ARG GOOSE_FILENAME="goose_${GOOSE_ARCH}"
ARG DOWNLOAD_URL="https://github.com/pressly/goose/releases/download/${GOOSE_VERSION}/${GOOSE_FILENAME}"
RUN apk add --no-cache curl
RUN curl -L -o /app/goose "${DOWNLOAD_URL}"
RUN chmod +x /app/goose
FROM scratch AS final
WORKDIR /usr/local/bin
COPY --from=downloader /app/goose .
ENTRYPOINT ["/usr/local/bin/goose"]
CMD ["--help"]