2025-10-26 15:23:56 +00:00
# @ship.zone/szci
2016-05-30 10:57:08 +02:00
2025-10-26 15:23:56 +00:00
**Serve Zone CI** - A powerful CI/CD tool for streamlining Node.js and Docker workflows within CI environments (GitLab CI, GitHub CI, Gitea CI). Now powered by Deno with standalone executables.
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
## ✨ Features
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
- 🚀 **Standalone Executables** - No Node.js installation required
- 🐳 **Docker Integration** - Build, tag, and push Docker images
- 📦 **NPM Management** - Install, test, and publish npm packages
- 🔧 **Node.js Version Management** - Install and switch between Node versions
- 🔐 **SSH Key Management** - Deploy SSH keys from environment variables
- ☁️ **Multi-Registry Support** - Push to multiple Docker registries
- 🎯 **Cross-Platform** - Binaries for Linux, macOS, and Windows
2017-04-03 00:06:00 +02:00
2025-10-26 15:23:56 +00:00
## 📥 Installation
2024-05-24 15:54:32 +02:00
2025-10-26 15:23:56 +00:00
### NPM (Recommended)
2024-05-24 15:54:32 +02:00
2025-10-26 15:23:56 +00:00
```sh
npm install -g @ship .zone/szci
2024-05-24 15:54:32 +02:00
```
2025-10-26 15:23:56 +00:00
The package will automatically download the appropriate pre-compiled binary for your platform.
2024-05-24 15:54:32 +02:00
2025-10-26 15:23:56 +00:00
### From Source (Deno Required)
2024-05-24 15:54:32 +02:00
2025-10-26 15:23:56 +00:00
```sh
git clone https://code.foss.global/ship.zone/szci.git
cd szci
deno task compile
2024-05-24 15:54:32 +02:00
```
2025-10-26 15:23:56 +00:00
## 🚀 Quick Start
2018-05-04 15:58:11 +02:00
2025-10-26 15:23:56 +00:00
```sh
# Install Node.js
szci node install stable
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
# Install dependencies
szci npm install
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
# Build Docker images
szci docker build
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
# Run tests
szci npm test
2018-05-04 15:58:11 +02:00
2025-10-26 15:23:56 +00:00
# Push Docker images
szci docker push registry.example.com
2024-05-24 00:17:31 +02:00
```
2018-05-04 15:58:11 +02:00
2025-10-26 15:23:56 +00:00
## 📖 Usage
2018-05-04 15:58:11 +02:00
2025-10-26 15:23:56 +00:00
### Node.js Management
2018-05-04 15:58:11 +02:00
2025-10-26 15:23:56 +00:00
```sh
# Install specific Node.js version
szci node install lts
szci node install stable
szci node install 18
2018-05-04 15:58:11 +02:00
2025-10-26 15:23:56 +00:00
# Install from .nvmrc
szci node install legacy
2018-05-04 15:58:11 +02:00
```
2025-10-26 15:23:56 +00:00
### NPM Commands
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
```sh
# Install dependencies
szci npm install
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
# Run tests
szci npm test
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
# Publish package
szci npm publish
2024-05-24 00:17:31 +02:00
```
2025-10-26 15:23:56 +00:00
### Docker Workflows
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
```sh
# Prepare Docker environment
szci docker prepare
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
# Build all Dockerfiles
szci docker build
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
# Push to registry
szci docker push registry.example.com
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
# Pull from registry
szci docker pull registry.example.com
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
# Test Dockerfiles
szci docker test
2024-05-24 00:17:31 +02:00
```
2025-10-26 15:23:56 +00:00
### SSH Key Management
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
```sh
# Deploy SSH keys from environment
szci ssh prepare
2024-05-24 00:17:31 +02:00
```
2025-10-26 15:23:56 +00:00
Set environment variables like `NPMCI_SSHKEY_1` , `NPMCI_SSHKEY_2` , etc.
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
## 🔧 CI/CD Integration
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
### GitLab CI
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
```yaml
image: denoland/deno:alpine
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
stages:
- prepare
- build
- test
- deploy
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
variables:
SZCI_VERSION: "latest"
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
before_script:
- deno install --allow-all --global --name szci https://code.foss.global/ship.zone/szci/raw/branch/master/mod.ts
# OR use the npm package:
# - npm install -g @ship .zone/szci
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
prepare:
stage: prepare
script:
- szci node install stable
- szci npm install
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
build:
stage: build
script:
- szci docker build
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
test:
stage: test
script:
- szci npm test
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
deploy:
stage: deploy
script:
- szci docker push $CI_REGISTRY
only:
- master
2024-05-24 00:17:31 +02:00
```
2025-10-26 15:23:56 +00:00
### GitHub Actions
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
```yaml
name: CI Pipeline
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
on:
push:
branches: [main]
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
jobs:
build:
runs-on: ubuntu-latest
2018-05-04 15:58:11 +02:00
2025-10-26 15:23:56 +00:00
steps:
- uses: actions/checkout@v3
2018-05-04 15:58:11 +02:00
2025-10-26 15:23:56 +00:00
- name: Install SZCI
run: npm install -g @ship .zone/szci
2018-05-04 15:58:11 +02:00
2025-10-26 15:23:56 +00:00
- name: Setup Node.js
run: szci node install stable
2018-05-04 15:58:11 +02:00
2025-10-26 15:23:56 +00:00
- name: Install Dependencies
run: szci npm install
2018-05-04 15:58:11 +02:00
2025-10-26 15:23:56 +00:00
- name: Build Docker Images
run: szci docker build
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
- name: Run Tests
run: szci npm test
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
- name: Push Images
if: github.ref == 'refs/heads/main'
run: szci docker push ghcr.io
2024-05-24 00:17:31 +02:00
```
2021-05-14 18:11:12 +00:00
2025-10-26 15:23:56 +00:00
## ⚙️ Configuration
Create an `npmextra.json` file in your project root:
```json
{
"npmci": {
"npmGlobalTools": [],
"npmAccessLevel": "public",
"npmRegistryUrl": "registry.npmjs.org",
"dockerRegistries": [
"registry.gitlab.com"
],
"dockerRegistryRepoMap": {
"registry.gitlab.com": "mygroup/myrepo"
},
"dockerBuildargEnvMap": {
"ARG_NAME": "ENV_VAR_NAME"
}
}
2024-05-24 00:17:31 +02:00
}
```
2025-10-26 15:23:56 +00:00
## 🐳 Docker Registry Authentication
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
SZCI supports automatic authentication with:
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
- GitLab CI Registry (via `CI_JOB_TOKEN` )
- Custom registries via environment variables
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
Set `NPMCI_LOGIN_DOCKER*` environment variables:
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
```sh
NPMCI_LOGIN_DOCKER_1="registry.example.com|username|password"
NPMCI_LOGIN_DOCKER_2="another-registry.com|user2|pass2"
2024-05-24 00:17:31 +02:00
```
2025-10-26 15:23:56 +00:00
## 🏗️ Development
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
### Prerequisites
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
- Deno 1.40+ installed
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
### Building from Source
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
```sh
# Clone the repository
git clone https://code.foss.global/ship.zone/szci.git
cd szci
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
# Compile for all platforms
deno task compile
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
# Compile for current platform only
deno compile --allow-all --output szci mod.ts
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
# Run tests
deno task test
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
# Development mode
deno task dev --help
```
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
### Testing
2024-05-24 00:17:31 +02:00
2025-10-26 17:44:43 +00:00
SZCI uses Deno's native test framework:
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
```sh
2025-10-26 17:44:43 +00:00
# Run all tests
2025-10-26 15:23:56 +00:00
deno task test
2025-10-26 17:44:43 +00:00
# Run tests in watch mode
deno task test:watch
# Run specific test file
deno test --allow-all test/test.cloudly.ts
2025-10-26 15:23:56 +00:00
```
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
## 📦 Binary Sizes
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
The standalone executables are approximately:
- Linux x64: ~800MB
- Linux ARM64: ~800MB
- macOS x64: ~796MB
- macOS ARM64: ~796MB
- Windows x64: ~804MB
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
Sizes include all dependencies and the Deno runtime.
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
## 🔄 Migration from npmci
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
If you're upgrading from the old `@ship.zone/npmci` package:
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
1. Update package references:
```sh
npm uninstall -g @ship .zone/npmci
npm install -g @ship .zone/szci
2024-05-24 00:17:31 +02:00
```
2025-10-26 15:23:56 +00:00
2. Update CI configuration files - replace `npmci` with `szci`
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
3. The command interface remains the same, only the binary name changed
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
## 📝 License
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
MIT © Lossless GmbH
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
## 🔗 Links
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
- [Repository ](https://code.foss.global/ship.zone/szci )
- [Issues ](https://code.foss.global/ship.zone/szci/issues )
- [Changelog ](./changelog.md )
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
## 🤝 Contributing
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
Contributions are welcome! Please feel free to submit a Pull Request.
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
---
2024-05-24 00:17:31 +02:00
2025-10-26 15:23:56 +00:00
**Built with Deno 🦕**