── ADVANCED ──

CI/CD Integration

Automate infrastructure generation in your CI/CD pipelines with Exo's non-interactive mode.

## Non-Interactive Mode

For CI/CD environments, use exo init with flags to skip the interactive wizard:

bash
exo init \
--name my-service \
--language go \
--framework gin \
--port 8080 \
--skip-prompt

## GitHub Actions Example

Generate and validate infrastructure files as part of your CI pipeline:

.github/workflows/infra.yml
1name: Infrastructure Generation
2
3on:
4 push:
5 branches: [main]
6 pull_request:
7 paths:
8 - '.exo.yaml'
9 - 'templates/**'
10
11jobs:
12 generate:
13 runs-on: ubuntu-latest
14 steps:
15 - uses: actions/checkout@v4
16
17 - name: Install Exo
18 run: |
19 curl -sSL https://raw.githubusercontent.com/Harsh-BH/Exo/main/install.sh | bash
20 echo "$HOME/.local/bin" >> $GITHUB_PATH
21
22 - name: Generate Infrastructure
23 run: |
24 exo gen docker
25 exo gen k8s
26 exo gen helm
27 exo gen ci
28
29 - name: Validate Generated Files
30 run: exo validate
31
32 - name: Lint Configuration
33 run: exo lint
34
35 - name: Upload Artifacts
36 uses: actions/upload-artifact@v4
37 with:
38 name: infrastructure
39 path: |
40 Dockerfile
41 k8s/
42 charts/
43 .github/workflows/ci.yml

## GitLab CI Example

.gitlab-ci.yml
1stages:
2 - generate
3 - validate
4
5generate-infra:
6 stage: generate
7 image: golang:1.25-alpine
8 before_script:
9 - go install github.com/Harsh-BH/Exo@latest
10 script:
11 - exo gen docker
12 - exo gen k8s
13 - exo gen terraform --cloud aws
14 artifacts:
15 paths:
16 - Dockerfile
17 - k8s/
18 - infra/
19
20validate-infra:
21 stage: validate
22 image: golang:1.25-alpine
23 before_script:
24 - go install github.com/Harsh-BH/Exo@latest
25 script:
26 - exo validate
27 - exo lint
28 needs: [generate-infra]

## Drift Detection

Detect when generated files have drifted from the templates. Useful as a PR check:

.github/workflows/drift.yml
1name: Drift Detection
2
3on:
4 pull_request:
5
6jobs:
7 check-drift:
8 runs-on: ubuntu-latest
9 steps:
10 - uses: actions/checkout@v4
11
12 - name: Install Exo
13 run: curl -sSL https://raw.githubusercontent.com/Harsh-BH/Exo/main/install.sh | bash
14
15 - name: Regenerate and Diff
16 run: |
17 exo gen docker
18 exo gen k8s
19 git diff --exit-code || (echo "⚠ Infrastructure drift detected!" && exit 1)

## Best Practices

▸ Pin the Exo version

Use a specific release tag in CI to ensure reproducible builds.

▸ Commit generated files

Keep Dockerfiles, K8s manifests, and CI configs in version control for auditability.

▸ Run validate + lint in CI

Catch misconfigurations before they reach production.

▸ Use .exo.yaml as single source of truth

All generation derives from the config — update it and regenerate.