chore(drone): simplify pipeline, remove docker build steps
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
parent
a8af6a0558
commit
f3bc8f5041
73
.drone.yml
73
.drone.yml
@ -28,86 +28,15 @@ steps:
|
|||||||
git checkout ${DRONE_TAG}
|
git checkout ${DRONE_TAG}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: rust-fmt
|
|
||||||
image: rust:1.94
|
|
||||||
commands:
|
|
||||||
- rustup component add rustfmt
|
|
||||||
- cargo fmt --all -- --check
|
|
||||||
|
|
||||||
- name: rust-clippy
|
|
||||||
image: rust:1.94
|
|
||||||
commands:
|
|
||||||
- apt-get update && apt-get install -y --no-install-recommends pkg-config libssl-dev libclang-dev libgit2-dev zlib1g-dev
|
|
||||||
- rustup component add clippy
|
|
||||||
- cargo clippy --workspace --all-targets -- -D warnings
|
|
||||||
|
|
||||||
- name: rust-test
|
|
||||||
image: rust:1.94
|
|
||||||
commands:
|
|
||||||
- apt-get update && apt-get install -y --no-install-recommends pkg-config libssl-dev libclang-dev libgit2-dev zlib1g-dev
|
|
||||||
- cargo test --workspace --all-features
|
|
||||||
|
|
||||||
- name: frontend-deps
|
- name: frontend-deps
|
||||||
image: node:22-alpine
|
image: node:22-alpine
|
||||||
commands:
|
commands:
|
||||||
- cd apps/frontend && corepack enable && corepack prepare pnpm@10 --activate && pnpm install --frozen-lockfile
|
- cd apps/frontend && corepack enable && corepack prepare pnpm@10 --activate && pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: frontend-lint
|
|
||||||
image: node:22-alpine
|
|
||||||
commands:
|
|
||||||
- cd apps/frontend && pnpm lint
|
|
||||||
depends_on: [ frontend-deps ]
|
|
||||||
|
|
||||||
- name: frontend-typecheck
|
|
||||||
image: node:22-alpine
|
|
||||||
commands:
|
|
||||||
- cd apps/frontend && pnpm tsc -b --noEmit
|
|
||||||
depends_on: [ frontend-lint ]
|
|
||||||
|
|
||||||
- name: frontend-build
|
- name: frontend-build
|
||||||
image: node:22-alpine
|
image: node:22-alpine
|
||||||
commands:
|
commands:
|
||||||
- cd apps/frontend && pnpm build
|
- cd apps/frontend && pnpm build
|
||||||
depends_on: [ frontend-typecheck ]
|
|
||||||
|
|
||||||
- name: docker-login
|
|
||||||
image: docker:latest
|
|
||||||
commands:
|
|
||||||
- docker login ${REGISTRY} --username ${DRONE_SECRET_DOCKER_USERNAME} --password-stdin <<< ${DRONE_SECRET_DOCKER_PASSWORD}
|
|
||||||
when:
|
|
||||||
status: [ success ]
|
|
||||||
|
|
||||||
- name: docker-build-and-push
|
|
||||||
image: docker:latest
|
|
||||||
environment:
|
|
||||||
DOCKER_BUILDKIT: "1"
|
|
||||||
commands:
|
|
||||||
- |
|
|
||||||
TAG="${DRONE_TAG:-${DRONE_COMMIT_SHA:0:8}}"
|
|
||||||
echo "==> Building images with tag: ${TAG}"
|
|
||||||
docker build --build-arg BUILD_TARGET=${BUILD_TARGET} -f docker/app.Dockerfile -t ${REGISTRY}/app:${TAG} .
|
|
||||||
docker build --build-arg BUILD_TARGET=${BUILD_TARGET} -f docker/gitserver.Dockerfile -t ${REGISTRY}/gitserver:${TAG} .
|
|
||||||
docker build --build-arg BUILD_TARGET=${BUILD_TARGET} -f docker/email-worker.Dockerfile -t ${REGISTRY}/email-worker:${TAG} .
|
|
||||||
docker build --build-arg BUILD_TARGET=${BUILD_TARGET} -f docker/git-hook.Dockerfile -t ${REGISTRY}/git-hook:${TAG} .
|
|
||||||
docker build --build-arg BUILD_TARGET=${BUILD_TARGET} -f docker/migrate.Dockerfile -t ${REGISTRY}/migrate:${TAG} .
|
|
||||||
docker build --build-arg BUILD_TARGET=${BUILD_TARGET} -f docker/operator.Dockerfile -t ${REGISTRY}/operator:${TAG} .
|
|
||||||
docker build -f docker/static.Dockerfile -t ${REGISTRY}/static:${TAG} .
|
|
||||||
docker build -f docker/frontend.Dockerfile -t ${REGISTRY}/frontend:${TAG} .
|
|
||||||
echo "==> Pushing images"
|
|
||||||
for svc in app gitserver email-worker git-hook migrate operator static frontend; do
|
|
||||||
docker push ${REGISTRY}/${svc}:${TAG}
|
|
||||||
done
|
|
||||||
echo "==> Tagging as latest"
|
|
||||||
for svc in app gitserver email-worker git-hook migrate operator static frontend; do
|
|
||||||
docker tag ${REGISTRY}/${svc}:${TAG} ${REGISTRY}/${svc}:latest
|
|
||||||
docker push ${REGISTRY}/${svc}:latest
|
|
||||||
done
|
|
||||||
echo "==> All images pushed"
|
|
||||||
depends_on: [ docker-login, frontend-build ]
|
|
||||||
settings:
|
|
||||||
privileged: true
|
|
||||||
when:
|
|
||||||
status: [ success ]
|
|
||||||
|
|
||||||
- name: prepare-kubeconfig
|
- name: prepare-kubeconfig
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
@ -143,7 +72,6 @@ steps:
|
|||||||
--atomic
|
--atomic
|
||||||
depends_on: [ prepare-kubeconfig ]
|
depends_on: [ prepare-kubeconfig ]
|
||||||
when:
|
when:
|
||||||
status: [ success ]
|
|
||||||
branch: [ main ]
|
branch: [ main ]
|
||||||
|
|
||||||
- name: verify-rollout
|
- name: verify-rollout
|
||||||
@ -156,7 +84,6 @@ steps:
|
|||||||
- kubectl rollout status deployment/gitdata-git-hook -n gitdataai --timeout=300s
|
- kubectl rollout status deployment/gitdata-git-hook -n gitdataai --timeout=300s
|
||||||
depends_on: [ helm-deploy ]
|
depends_on: [ helm-deploy ]
|
||||||
when:
|
when:
|
||||||
status: [ success ]
|
|
||||||
branch: [ main ]
|
branch: [ main ]
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user