Commit 398f52c
Eric Bower
·
2026-05-11 09:55:20 -0400 EDT
parent b0db3e1
chore: pico.sh ci script
2 files changed,
+56,
-0
+13,
-0
1@@ -0,0 +1,13 @@
2+FROM golang:1.25.0-alpine
3+
4+RUN apk add rsync openssh make gcc musl-dev
5+
6+WORKDIR /app
7+
8+COPY go.mod go.sum Makefile /app
9+
10+RUN go mod download
11+
12+ENV PICO_SECRET="danger"
13+
14+CMD ["go", "test", "-race", "./..."]
A
pico.sh
+43,
-0
1@@ -0,0 +1,43 @@
2+#!/usr/bin/env bash
3+set -euo pipefail
4+
5+export ZMX_SESSION_PREFIX="${ZMX_SESSION_PREFIX:-ci.pico.}"
6+JOB_ID="${PICO_CI_JOB_ID:-local}"
7+EVENT_TYPE="${PICO_CI_EVENT_TYPE:-manual}"
8+
9+printf "\x1b[33m[%s] running ci (event=%s)\x1b[0m\n" "$JOB_ID" "$EVENT_TYPE"
10+
11+zmx run lint -d docker run -t --rm -v $(pwd):/app -w /app golangci/golangci-lint:v2.11.4 golangci-lint run
12+cat << EOF | zmx run tests -d
13+docker build -t pico-test -f ./Dockerfile.test . && \
14+docker run -t --rm -v $(pwd):/app pico-test
15+EOF
16+zmx wait "*"
17+printf "\x1b[32msuccess tests!\x1b[0m\n"
18+
19+if [ "$EVENT_TYPE" != "release" ]; then
20+ exit 0
21+fi
22+
23+DOCKER_TAG="latest"
24+DOCKER_PLATFORM="linux/amd64,linux/arm64"
25+
26+docker buildx ls | grep pico || docker buildx create --name pico
27+docker buildx use pico
28+zmx run caddy -d docker buildx build --push --platform "$DOCKER_PLATFORM" -t "ghcr.io/picosh/pico/caddy:$DOCKER_TAG" ./caddy
29+zmx run bouncer docker buildx build --push --platform "$DOCKER_PLATFORM" -t "ghcr.io/picosh/pico/bouncer:$DOCKER_TAG" ./bouncer
30+zmx wait "*"
31+
32+zmx run auth docker buildx build --push --platform "$DOCKER_PLATFORM" -t "ghcr.io/picosh/pico/auth-web:$DOCKER_TAG" --build-arg APP=auth --target release-web .
33+zmx run cdn docker buildx build --push --platform "$DOCKER_PLATFORM" -t "ghcr.io/picosh/pico/pgs-cdn:$DOCKER_TAG" --target release-web -f Dockerfile.cdn .
34+zmx run standalone docker buildx build --push --platform "$DOCKER_PLATFORM" -t "ghcr.io/picosh/pgs:$DOCKER_TAG" --target release -f Dockerfile.standalone .
35+zmx wait "*"
36+
37+apps=("prose" "pastes" "pgs" "feeds" "pipe")
38+for APP in "${apps[@]}"; do
39+ zmx run "$APP-ssh" -d docker buildx build --push --platform "$DOCKER_PLATFORM" -t "ghcr.io/picosh/pico/$APP-ssh:$DOCKER_TAG" --build-arg "APP=$APP" --target release-ssh .
40+ zmx run "$APP-web" -d docker buildx build --push --platform "$DOCKER_PLATFORM" -t "ghcr.io/picosh/pico/$APP-web:$DOCKER_TAG" --build-arg "APP=$APP" --target release-web .
41+ zmx wait "*"
42+done
43+
44+printf "\x1b[32msuccess release!\x1b[0m\n"