Add deployment quickstart guide
This commit is contained in:
parent
740d881d97
commit
52db3542f5
1 changed files with 221 additions and 2 deletions
223
README.md
223
README.md
|
|
@ -1,3 +1,222 @@
|
||||||
# quickstart
|
# Deploy to InsureCo Git
|
||||||
|
|
||||||
How to deploy to git.insureco.io
|
Push your code to **git.insureco.io** and it deploys automatically.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5-Minute Setup
|
||||||
|
|
||||||
|
### Step 1: Get Access
|
||||||
|
|
||||||
|
1. Go to [git.insureco.io](https://git.insureco.io)
|
||||||
|
2. Sign in with **bio-id** (or create an account)
|
||||||
|
3. Go to **Settings → Applications → Generate Token**
|
||||||
|
4. Save your token
|
||||||
|
|
||||||
|
### Step 2: Configure Git
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Add to ~/.ssh/config
|
||||||
|
cat >> ~/.ssh/config << 'EOF'
|
||||||
|
Host git.insureco.io
|
||||||
|
HostName git.insureco.io
|
||||||
|
Port 2222
|
||||||
|
User jci-admin
|
||||||
|
IdentityFile ~/.ssh/id_ed25519
|
||||||
|
EOF
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 3: Create Your Service
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install CLI
|
||||||
|
npm install -g @insureco/cli
|
||||||
|
|
||||||
|
# Login
|
||||||
|
iec git login YOUR_TOKEN
|
||||||
|
|
||||||
|
# Add your SSH key
|
||||||
|
iec git ssh-key
|
||||||
|
|
||||||
|
# Create a repo
|
||||||
|
iec git create my-service
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 4: Push Your Code
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Clone and add your code
|
||||||
|
git clone git@git.insureco.io:insureco/my-service.git
|
||||||
|
cd my-service
|
||||||
|
|
||||||
|
# Add a Dockerfile
|
||||||
|
cat > Dockerfile << 'EOF'
|
||||||
|
FROM node:20-alpine
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm ci --production
|
||||||
|
COPY . .
|
||||||
|
EXPOSE 3000
|
||||||
|
CMD ["node", "src/index.js"]
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Push
|
||||||
|
git add -A
|
||||||
|
git commit -m "Initial deployment"
|
||||||
|
git push origin main
|
||||||
|
```
|
||||||
|
|
||||||
|
**That's it!** Your service will build and deploy automatically.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## What Happens When You Push
|
||||||
|
|
||||||
|
```
|
||||||
|
git push origin main
|
||||||
|
│
|
||||||
|
▼
|
||||||
|
┌─────────────────────┐
|
||||||
|
│ git.insureco.io │ ← Receives push
|
||||||
|
└──────────┬──────────┘
|
||||||
|
│ webhook
|
||||||
|
▼
|
||||||
|
┌─────────────────────┐
|
||||||
|
│ iec-builder │ ← Builds Docker image
|
||||||
|
└──────────┬──────────┘
|
||||||
|
│ deploys
|
||||||
|
▼
|
||||||
|
┌─────────────────────┐
|
||||||
|
│ Kubernetes │ ← Runs your service
|
||||||
|
└─────────────────────┘
|
||||||
|
│
|
||||||
|
▼
|
||||||
|
https://my-service.tawa.insureco.io
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Branch → Environment
|
||||||
|
|
||||||
|
| Push to | Deploys to | URL |
|
||||||
|
|---------------|---------------|----------------------------------------|
|
||||||
|
| `main` | Production | `my-service.tawa.insureco.io` |
|
||||||
|
| `develop` | Sandbox | `my-service.sandbox.tawa.insureco.io` |
|
||||||
|
| `staging` | UAT | `my-service.uat.tawa.insureco.io` |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Required Files
|
||||||
|
|
||||||
|
Your repo needs at minimum:
|
||||||
|
|
||||||
|
```
|
||||||
|
my-service/
|
||||||
|
├── Dockerfile # How to build your app
|
||||||
|
├── package.json # (or requirements.txt, go.mod, etc.)
|
||||||
|
└── src/
|
||||||
|
└── index.js # Your app code
|
||||||
|
```
|
||||||
|
|
||||||
|
### Example Dockerfile (Node.js)
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
FROM node:20-alpine
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm ci --production
|
||||||
|
COPY . .
|
||||||
|
EXPOSE 3000
|
||||||
|
CMD ["node", "src/index.js"]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Example Dockerfile (Python)
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
FROM python:3.11-slim
|
||||||
|
WORKDIR /app
|
||||||
|
COPY requirements.txt .
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
COPY . .
|
||||||
|
EXPOSE 8000
|
||||||
|
CMD ["python", "app.py"]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Example Dockerfile (Go)
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
FROM golang:1.21-alpine AS builder
|
||||||
|
WORKDIR /app
|
||||||
|
COPY go.* ./
|
||||||
|
RUN go mod download
|
||||||
|
COPY . .
|
||||||
|
RUN go build -o main .
|
||||||
|
|
||||||
|
FROM alpine:latest
|
||||||
|
COPY --from=builder /app/main /main
|
||||||
|
EXPOSE 8080
|
||||||
|
CMD ["/main"]
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Monitor Your Deployment
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Watch build progress
|
||||||
|
iec builds
|
||||||
|
|
||||||
|
# View logs
|
||||||
|
iec logs my-service
|
||||||
|
|
||||||
|
# Check status
|
||||||
|
iec status my-service
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## CLI Reference
|
||||||
|
|
||||||
|
```bash
|
||||||
|
iec git login <token> # Authenticate
|
||||||
|
iec git list # List your repos
|
||||||
|
iec git create <name> # Create repo + webhook
|
||||||
|
iec git clone <name> # Clone a repo
|
||||||
|
iec git ssh-key # Add SSH key
|
||||||
|
|
||||||
|
iec deploy # Manual deploy
|
||||||
|
iec builds # List builds
|
||||||
|
iec logs <service> # View logs
|
||||||
|
iec status <service> # Check status
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### Can't push?
|
||||||
|
```bash
|
||||||
|
# Test SSH connection
|
||||||
|
ssh -T -p 2222 jci-admin@git.insureco.io
|
||||||
|
|
||||||
|
# Should see: "Hi there, USERNAME!"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Build not triggering?
|
||||||
|
```bash
|
||||||
|
# Check webhook exists
|
||||||
|
iec git get my-service
|
||||||
|
|
||||||
|
# Add webhook manually
|
||||||
|
iec git webhook my-service
|
||||||
|
```
|
||||||
|
|
||||||
|
### Need help?
|
||||||
|
- API Docs: [git.insureco.io/api/swagger](https://git.insureco.io/api/swagger)
|
||||||
|
- Platform team: #platform-support
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<strong>git.insureco.io</strong> — Push code. Ship fast.
|
||||||
|
</p>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue