Skip to content

Commit 9e1588a

Browse files
committed
chore: initial public release
0 parents  commit 9e1588a

133 files changed

Lines changed: 19396 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codex/skills/ship/SKILL.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: ship
3+
description: Use when the user asks to deploy the current project with Ship, usually as "$ship deploy this project as <service>". Prepares the project, creates a Dockerfile when needed, runs a dry-run first, then deploys after the plan is valid.
4+
---
5+
6+
# Ship
7+
8+
Deploy a local project with the `ship` CLI.
9+
10+
## Workflow
11+
12+
1. Identify the target project directory.
13+
2. Derive the service name from the user request. If absent, use the current directory name normalized to DNS-safe lowercase.
14+
3. If the project has no `Dockerfile`, inspect the project and create a minimal suitable one using its existing runtime, lockfile, package manager, build script, and start command. If the runtime cannot be inferred safely, stop and report the missing information.
15+
4. Run the dry-run first:
16+
17+
```sh
18+
ship --service <service> --cwd <project-dir> --dry-run --json
19+
```
20+
21+
5. Read the JSON plan. Stop and report the exact error if planning fails.
22+
6. If the plan is valid and the user asked to deploy, run:
23+
24+
```sh
25+
ship --service <service> --cwd <project-dir>
26+
```
27+
28+
7. Verify with the rollout command from the plan, then report the deployed host.
29+
30+
## Rules
31+
32+
- Prefer an existing `Dockerfile`; do not overwrite it unless the user explicitly asks.
33+
- Keep generated Dockerfiles minimal and conventional. Use detected project commands instead of adding new dependencies.
34+
- Do not invent domain, namespace, gateway, registry, or cluster values. Let `ship` read `~/.config/ship/config.env`, environment variables, and CLI defaults.
35+
- Use `--env-file` only when the user names an env file or the project has a clear deployment env file such as `.env.production`.
36+
- Use `--exposure internet` only when the user explicitly asks for public internet exposure.
37+
- If you created a `Dockerfile`, mention that in the final report.
38+
- Keep deployment output concise: service, host, image, namespace, and verification command result.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Ship"
3+
short_description: "Deploy Dockerfile projects with Ship"
4+
default_prompt: "Use $ship to deploy the current Dockerfile project as demo."

.dockerignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.git
2+
.github
3+
.omo
4+
.omx
5+
.codegraph
6+
.env
7+
.env.*
8+
bin
9+
dist
10+
node_modules
11+
start-app/node_modules
12+
start-app/dist
13+
start-app/.tanstack
14+
start-app/.output
15+
start-app/.vinxi
16+
*.tsbuildinfo

.env.example

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
SHIP_DOMAIN=mydomain.com
2+
CLOUDFLARE_API_TOKEN=
3+
TAILSCALE_CLIENT_ID=
4+
TAILSCALE_CLIENT_SECRET=
5+
# Optional. ship install can usually infer these from the token and domain.
6+
# CLOUDFLARE_ACCOUNT_ID=
7+
# CLOUDFLARE_ZONE_ID=
8+
# Optional ACME account email. Defaults to admin@$SHIP_DOMAIN.
9+
# SHIP_ACME_EMAIL=admin@mydomain.com
10+
# Optional dashboard service name.
11+
# Defaults to k8s, which gives you k8s.your-domain.com.
12+
# SHIP_DASHBOARD_SERVICE=ops
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Bug report
2+
description: Report something that is broken or unsafe.
3+
title: "bug: "
4+
labels:
5+
- bug
6+
body:
7+
- type: textarea
8+
id: what-happened
9+
attributes:
10+
label: What happened?
11+
description: Describe the behavior and what you expected instead.
12+
validations:
13+
required: true
14+
- type: textarea
15+
id: reproduce
16+
attributes:
17+
label: Reproduction steps
18+
description: Include commands, config, cluster type, and relevant logs.
19+
validations:
20+
required: true
21+
- type: input
22+
id: version
23+
attributes:
24+
label: Commit or version
25+
placeholder: main, tag, or commit SHA
26+
validations:
27+
required: true
28+
- type: textarea
29+
id: environment
30+
attributes:
31+
label: Environment
32+
description: Go, Docker, kubectl, Kubernetes, Gateway, and dashboard versions.
33+
validations:
34+
required: true
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Feature request
2+
description: Suggest a scoped improvement.
3+
title: "feat: "
4+
labels:
5+
- enhancement
6+
body:
7+
- type: textarea
8+
id: problem
9+
attributes:
10+
label: Problem
11+
description: What deployment or operations problem should this solve?
12+
validations:
13+
required: true
14+
- type: textarea
15+
id: proposal
16+
attributes:
17+
label: Proposal
18+
description: Describe the smallest useful version.
19+
validations:
20+
required: true
21+
- type: dropdown
22+
id: exposure
23+
attributes:
24+
label: Exposure mode
25+
options:
26+
- Tailscale-only
27+
- Internet
28+
- Both
29+
- Not applicable
30+
validations:
31+
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## Summary
2+
3+
-
4+
5+
## Validation
6+
7+
- [ ] `make test`
8+
9+
## Notes
10+
11+
-

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
- package-ecosystem: gomod
8+
directory: /
9+
schedule:
10+
interval: weekly
11+
- package-ecosystem: npm
12+
directory: /start-app
13+
schedule:
14+
interval: weekly

.github/workflows/ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
verify:
14+
name: Verify
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version-file: go.mod
24+
cache: true
25+
26+
- name: Set up pnpm
27+
uses: pnpm/action-setup@v4
28+
with:
29+
version: 11.6.0
30+
run_install: false
31+
32+
- name: Set up Node
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: 24
36+
cache: pnpm
37+
cache-dependency-path: start-app/pnpm-lock.yaml
38+
39+
- name: Install dashboard dependencies
40+
working-directory: start-app
41+
run: pnpm install --frozen-lockfile
42+
43+
- name: Release readiness
44+
run: ./scripts/check-release-readiness.sh
45+
46+
- name: Go tests
47+
run: go test ./...
48+
49+
- name: Dashboard tests
50+
working-directory: start-app
51+
run: |
52+
pnpm test
53+
pnpm typecheck
54+
pnpm lint
55+
56+
- name: Dashboard build
57+
working-directory: start-app
58+
run: pnpm build

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
name: Release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version-file: go.mod
23+
cache: true
24+
25+
- name: Test
26+
run: go test ./...
27+
28+
- name: Build CLI archives
29+
env:
30+
VERSION: ${{ github.ref_name }}
31+
run: |
32+
set -eu
33+
mkdir -p dist
34+
for target in darwin/amd64 darwin/arm64 linux/amd64 linux/arm64; do
35+
os="${target%/*}"
36+
arch="${target#*/}"
37+
name="ship_${VERSION}_${os}_${arch}"
38+
GOOS="$os" GOARCH="$arch" go build \
39+
-ldflags "-X main.version=${VERSION} -X main.sourceRef=${VERSION}" \
40+
-o "dist/${name}/ship" ./cmd/ship
41+
tar -czf "dist/${name}.tar.gz" -C "dist/${name}" ship
42+
done
43+
44+
- name: Publish GitHub Release
45+
env:
46+
GH_TOKEN: ${{ github.token }}
47+
VERSION: ${{ github.ref_name }}
48+
run: |
49+
gh release create "$VERSION" dist/*.tar.gz \
50+
--title "$VERSION" \
51+
--generate-notes

0 commit comments

Comments
 (0)