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 type: docker
name: 构建 Goose name: 构建 Goose
workspace:
path: /drone/src
steps: 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 包 - name: 构建 Goose Docker 包
image: docker:latest image: docker:latest
privileged: true privileged: true
@ -39,11 +17,8 @@ steps:
volumes: volumes:
- name: docker-socket - name: docker-socket
path: /var/run/docker.sock path: /var/run/docker.sock
- name: place-goose
path: /place-goose
commands: commands:
- mv /place-goose/goose /drone/src/goose-bin
- echo "$PASSWORD" | docker login -u "$USERNAME" --password-stdin "$DOCKER_REGISTRY" - 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:$DRONE_BUILD_NUMBER" .
- docker build -t "$DOCKER_REGISTRY/$DOCKER_ORGANIZATION/$DOCKER_APPLICATION:latest" . - docker build -t "$DOCKER_REGISTRY/$DOCKER_ORGANIZATION/$DOCKER_APPLICATION:latest" .
@ -53,6 +28,4 @@ steps:
volumes: volumes:
- name: docker-socket - name: docker-socket
host: host:
path: /var/run/docker.sock path: /var/run/docker.sock
- name: place-goose
temp: {}

View File

@ -1,5 +1,17 @@
FROM scratch FROM alpine:3.19 AS downloader
COPY goose-bin /goose WORKDIR /app
WORKDIR /
RUN chmod +x /goose ARG GOOSE_VERSION="v3.24.3"
ENTRYPOINT ["/goose"] 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"]