CLI untuk sinkronisasi file/devsync via SSH, dengan mode aman (safe pull/push), menu interaktif, dan dukungan manual sync berbasis path terdaftar maupun pola ! dari .sync_ignore.
- Safe Pull/Push: indeks remote (SQLite) dibuat dulu, lalu bandingkan hash untuk unduh/unggah yang berubah saja.
- Manual/Single Sync Menu:
- Download/Upload
- Pilih folder: salah satu path terdaftar, semua yang terdaftar, atau berdasarkan pola
!di.sync_ignore - Mode: Rsync Soft (tanpa delete) atau Rsync Force (dengan delete terbatas scope)
- Force Mode (Rsync-like delete):
- Download Force: hapus file lokal yang tidak ada di DB remote dalam scope pilihan
- Upload Force: hapus file remote yang tidak ada di lokal (gunakan kolom
checkeddi DB bila ada)
.sync_ignorecerdas: menghormati.sync_tempdan pola wildcard (termasuk**), serta mendukung "include by negation" via!pattern.- SSH Agent Remote: otomatis build atau pakai fallback binary, jalankan indexing di remote, unduh DB.
- Butuh Go 1.24+.
- Jalankan:
go build ./...
Jika ingin menjalankan seluruh test (yang ada):
go test ./...
Konfigurasi utama di make-sync.yaml. Contoh minimal:
local_path: .
remote_path: /home/user/project
devsync:
os_target: linux # atau windows
auth:
host: 1.2.3.4
port: "22"
username: youruser
private_key: C:\\Users\\you\\.ssh\\id_rsa
remote_path: /home/user/project
local_path: .
ignores:
- .sync_temp
manual_transfer:
- src
- assets/imagesCatatan:
devsync.auth.remote_pathadalah root project di remote.devsync.manual_transferadalah daftar path yang ditampilkan di menu Manual/Single Sync..sync_ignoredi root mengatur pola ignore biasa, dan juga bisa memuat pola negasi!patternuntuk fitur include-by-pattern.
make-sync mendukung pembuatan file SSH config otomatis untuk akses langsung ke remote server. Konfigurasi ini memungkinkan koneksi SSH yang lebih mudah tanpa perlu mengetik kredensial berulang.
RemoteCommand di direct_access.ssh_configs harus disesuaikan dengan target OS:
RemoteCommand: cmd /K cd =remotePath- Menggunakan
cmd /Kuntuk menjaga command prompt tetap terbuka cd =remotePathuntuk berpindah ke direktori project
RemoteCommand: cd =remotePath && bash -l- Menggunakan
bash -luntuk login shell cd =remotePathuntuk berpindah ke direktori project
direct_access:
config_file: "" # Kosongkan untuk generate otomatis ke .sync_temp/.ssh/config
ssh_configs:
- Host: my-server
HostName: 192.168.1.100
User: username
Port: "22"
RemoteCommand: cmd /K cd =remotePath # Untuk Windows target
RequestTty: force
StrictHostKeyChecking: "no"
ServerAliveInterval: "300"
ServerAliveCountMax: "2"
ssh_commands:
- access_name: Connect to Server
command: ssh -v my-server- Jalankan
make-sync direct_accessuntuk generate SSH config - File config akan dibuat di
.sync_temp/.ssh/config - Gunakan
ssh my-serveruntuk koneksi langsung - RemoteCommand akan otomatis menjalankan command sesuai target OS
- Jalankan binary
make-sync.exe(Windows) ataumake-sync(Unix). - Di menu utama pilih DevSync → Single/Manual Sync.
- Pilih Download atau Upload.
- Pilih scope:
- Salah satu path terdaftar (dari
devsync.manual_transfer) - "All data registered in manual_sync only" (semua path terdaftar)
- "All Data Only In Your "Sync Ignore" File Pattern" (berdasarkan
!patternsdari.sync_ignore)
- Salah satu path terdaftar (dari
- Pilih mode:
- Rsync Soft Mode: hanya transfer file yang berubah, tanpa penghapusan
- Rsync Force Mode: selain transfer, juga melakukan penghapusan file yang tidak ada pada sisi lain, terbatas pada scope pilihan
Selama Download/Upload:
- Sistem akan menjalankan indexing di remote terlebih dahulu (mirroring safe pull/push) agar DB up-to-date.
- Back bertahap: gunakan item menu "Back" untuk naik satu level.
- Keluar cepat: Esc, q, atau Ctrl+C akan keluar dari seluruh flow Single/Manual Sync.
- Catatan: Mode Force tidak menampilkan prompt konfirmasi.
- Download Soft: unduh file remote yang belum ada atau hash berbeda, dalam scope.
- Download Force: setelah unduh, hapus file lokal yang match scope namun tidak ada di DB remote.
- Upload Soft: unggah file lokal yang belum ada atau hash berbeda, dalam scope.
- Upload Force: tandai setiap file lokal yang diproses sebagai
checked(di DB bila tersedia), lalu hapus file remote match scope yang tidakchecked. - Scope "Sync Ignore !patterns":
- Matcher dibangun dengan basis ignore semua (
**), lalu di-"unignore" oleh tiap negation pattern (ditambah varian**/untuk token pendek). .sync_tempselalu diabaikan.- Pola ignore
.sync_ignoretetap dihormati saat traversing.
- Matcher dibangun dengan basis ignore semua (
- Pastikan
devsync.authterisi benar untuk koneksi SSH. - Jika build agent gagal, sistem akan mencoba fallback binary di folder
.sync_tempsesuai target OS. - Force Mode tidak menampilkan prompt konfirmasi. Pastikan scope sudah tepat sebelum mengeksekusi.
- Untuk Windows remote, penghapusan file menggunakan
cmd.exe /C del /f /q.
.sync_tempselalu dikecualikan dari sinkronisasi.- Pola di
.sync_ignoretetap dihormati saat traversal lokal.
Jalankan perintah langsung di host remote tanpa PTY. Output di-stream real-time; selesai → proses exit dengan status yang sesuai.
Penggunaan:
make-sync exec <command...>
Perilaku:
- Bekerja dari direktori kerja remote:
devsync.auth.remote_path(fallbackremote_path). Jika kosong, tidak melakukancd. - Pembungkus shell otomatis:
- Linux/Unix:
bash -lc 'cd <remotePath> && <command>' - Windows:
cmd.exe /C "cd /d <remotePath> && <command>"
- Linux/Unix:
- Tidak ada flag lokal untuk
exec(DisableFlagParsing). Semua argumen setelahexecditeruskan apa adanya ke remote shell. - Non-PTY: tidak cocok untuk perintah yang butuh TTY/prompt interaktif.
- Exit code: 0 jika sukses; non-zero jika eksekusi gagal.
Contoh:
- Tampilkan file tersembunyi (Linux/Unix):
make-sync exec ls -a -l
- Docker compose restart (semua target OS):
make-sync exec docker compose down && docker compose up
- Menjalankan beberapa perintah berantai:
make-sync exec mkdir -p release && cd release && ls
Tips quoting:
- Windows: operator seperti
&&,|, atau path dengan spasi tetap didukung karena dibungkuscmd.exe /C. Jika ada karakter kutip ganda di command, pertimbangkan untuk mengutip ulang bagian terkait. - Linux/Unix: command dibungkus ke
bash -lc '...'. Jika Anda perlu menyertakan'di dalam command, gunakan escape'\''atau beralih ke kutip ganda dengan hati-hati.
Troubleshooting:
- "command not found": pastikan perintah tersedia di PATH remote, atau gunakan path absolut/bin yang tepat.
- Salah direktori kerja: set
devsync.auth.remote_path(atauremote_path) pada config agarcdotomatis ke root project di remote.
make-sync menyediakan sistem pipeline yang powerful untuk menjalankan workflow otomatisasi CI/CD dengan dukungan SSH, variable persistence, dan conditional execution.
- Job Dependencies: Definisi dependensi antar job untuk eksekusi berurutan
- Variable Persistence: Simpan output command ke variable yang bisa digunakan job berikutnya
- Conditional Execution: Jalankan job berdasarkan success/failure job sebelumnya
- SSH Execution: Jalankan command di remote server via SSH
- Real-time Output Streaming: Tampilkan output command secara real-time saat eksekusi
- Pipeline Logging: Semua output otomatis tersimpan ke log file dengan timestamp
- Silent Mode: Kontrol tampilan output per step untuk output yang lebih bersih
- Timeout Control: Dual timeout system (idle + total) untuk kontrol eksekusi yang lebih cerdas
- Subroutine Calls: Panggil job tertentu menggunakan
goto_jobuntuk error handling - Template Generation: Buat pipeline template Docker-focused dengan mudah
- Job Execution Tracking: Visual indicators dengan HEAD markers untuk tracking progress
Gunakan command pipeline create untuk membuat template pipeline baru:
# Dari directory dengan konfigurasi pipeline_dir
make-sync pipeline create my-app
# Akan membuat file di pipeline_dir (default: .sync_pipelines/my-app.yaml)Template yang dihasilkan mencakup:
- 5 Jobs: prepare, build, test, deploy, rollback
- Docker Integration: Build, test, dan deploy aplikasi container
- Variable Management: Persistent variables untuk tracking build info
- Error Handling: Conditional rollback pada failure
- SSH Deployment: Multi-host deployment support
pipeline:
name: "my-app"
description: "Docker-based CI/CD pipeline"
strict_variables: false
variables:
DOCKER_REGISTRY: "docker.io"
DOCKER_REPO: "your-org/my-app"
DOCKER_TAG: "latest"
jobs:
- name: "prepare"
mode: "local" # Run steps locally (no SSH)
steps:
- name: "check-docker"
type: "command"
commands: ["docker --version"]
- name: "build"
mode: "local" # Run steps locally
depends_on: ["prepare"]
steps:
- name: "build-image"
type: "command"
commands: ["docker build -t {{DOCKER_REGISTRY}}/{{DOCKER_REPO}}:{{DOCKER_TAG}} ."]
save_output: "image_id"
- name: "deploy"
mode: "remote" # Run steps via SSH (default)
depends_on: ["build"]
steps:
- name: "upload-files"
type: "file_transfer"
source: "dist/"
destination: "/var/www/app/"
- name: "restart-service"
type: "command"
commands: ["systemctl restart myapp"]
executions:
- name: "Development Build"
key: "dev"
pipeline: "my-app.yaml"
var: "dev" # Reference ke vars.yaml
hosts: ["localhost"]
- name: "Production Deploy"
key: "prod"
pipeline: "my-app.yaml"
var: "prod" # Reference ke vars.yaml
hosts: ["prod-server-01", "prod-server-02"]
### Job Configuration
Jobs dalam pipeline dapat dikonfigurasi dengan mode eksekusi:
| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `name` | string | - | Unique job identifier |
| `depends_on` | []string | - | Jobs that must complete before this job runs |
| `mode` | string | "remote" | Execution mode: `"local"` or `"remote"` |
| `steps` | []Step | - | Steps to execute in this job |
#### Job Execution Modes
- **`local`**: Semua step dijalankan secara lokal tanpa SSH
- Command steps: Jalankan di mesin lokal
- File transfer steps: Copy file lokal (bukan upload via SCP)
- Script steps: Jalankan script lokal
- **`remote`** (default): Semua step dijalankan via SSH ke remote host
- Command steps: Jalankan via SSH
- File transfer steps: Upload/download via SCP
- Script steps: Upload dan jalankan script via SSH
#### Example Usage
```yaml
jobs:
- name: "local-build"
mode: "local"
steps:
- name: "install-deps"
commands: ["npm install"]
- name: "copy-assets"
type: "file_transfer"
source: "src/assets/"
destination: "dist/assets/"
- name: "remote-deploy"
mode: "remote"
steps:
- name: "upload-app"
type: "file_transfer"
source: "dist/"
destination: "/var/www/app/"Setiap step dalam pipeline mendukung konfigurasi advanced untuk kontrol eksekusi yang lebih detail:
steps:
- name: "build-app"
type: "command"
commands: ["npm run build"]
description: "Build the application"steps:
- name: "ping-test"
type: "command"
commands: ["ping -c 5 google.com"]
description: "Test network connectivity"
silent: true # Suppress real-time output display
timeout: 30 # Total timeout in seconds (default: 0 = unlimited)
idle_timeout: 300 # Idle timeout in seconds (default: 600 = 10 minutes)
working_dir: "/app" # Override working directory
save_output: "ping_result" # Save command output to variable
conditions: # Conditional execution
- pattern: "5 packets"
action: "continue"| Field | Type | Default | Description |
|---|---|---|---|
name |
string | - | Unique step identifier |
type |
string | - | Step type: command, file_transfer, script |
commands |
[]string | - | Commands to execute (for command type) |
file |
string | - | Script file path (for script type) |
source |
string | - | Source path (for file_transfer type) |
destination |
string | - | Destination path (for file_transfer type) |
direction |
string | "upload" | Transfer direction: upload or download |
template |
string | - | Template rendering: "enabled" to render {{variables}} in file content |
description |
string | - | Human-readable description |
silent |
bool | false | Suppress real-time output display |
timeout |
int | 0 | Total timeout in seconds (0 = unlimited) |
idle_timeout |
int | 600 | Idle timeout in seconds (10 minutes) - resets on output activity |
working_dir |
string | - | Override working directory for this step |
save_output |
string | - | Save command output to context variable |
conditions |
[]Condition | - | Conditional execution based on output |
expect |
[]Expect | - | Interactive prompt responses |
You can provide multiple files in a single file_transfer step using the files array. Each entry can specify its own source, an optional per-file destination, and an optional template override. When files is present it takes priority over the older source / sources fields.
Example:
- name: "upload-files"
type: "file_transfer"
files:
- source: "xxx.txt"
destination: "/xxx/xxx/xxx.txt"
- source: "vvv.txt"
destination: "/xxx/xxx/vvv.txt"
- source: "dist/"
destination: "/xxx/dist/"Behavior notes:
- If
filesis present, it overridessourceandsourcesfor that step. - Each file entry may provide its own
destination; if omitted, the step-leveldestinationis used. - Globs in
source(e.g.dist/**/*.js) are expanded locally and each match is transferred preserving relative paths under the destination directory. template: "enabled"may be set per-step or per-file; per-filetemplateoverrides the step-level setting.- If multiple files are provided and the resolved destination is a directory (ends with
/or exists as a directory), all files will be placed under that directory. If multiple files are provided but destination looks like a single file path, the step will error. - Backwards compatibility: existing single-file
sourceusage still works iffilesis not present.
Pipeline mendukung dua jenis timeout untuk kontrol eksekusi yang lebih fleksibel:
- Default: 0 (unlimited)
- Behavior: Total waktu maksimal eksekusi command
- Use case: Mencegah command yang benar-benar stuck berjalan terlalu lama
- Default: 600 seconds (10 minutes)
- Behavior: Waktu maksimal tanpa aktivitas output - timer reset setiap ada output baru
- Use case: Ideal untuk command yang memberikan progress feedback (download, build, dll)
steps:
- name: "download-large-file"
type: "command"
commands: ["wget https://example.com/large-file.zip"]
timeout: 3600 # Total timeout: 1 hour max
idle_timeout: 300 # Idle timeout: 5 minutes (resets on download progress)
- name: "compile-project"
type: "command"
commands: ["make all"]
timeout: 0 # No total timeout limit
idle_timeout: 600 # 10 minutes idle timeout (resets on compiler output)Timeout Logic:
- Command akan timeout jika melebihi total timeout ATAU tidak ada output selama idle timeout
- Timer idle otomatis reset setiap kali command menghasilkan output
- Total timeout 0 = unlimited (hanya idle timeout yang berlaku)
Field conditions pada step pipeline memungkinkan branching atau aksi khusus berdasarkan output command. Dengan ini, pipeline bisa otomatis lanjut, lompat, atau melakukan error handling sesuai hasil eksekusi.
- Setelah command dijalankan, outputnya dicek terhadap pola (regex atau string match) di
conditions. - Jika pola cocok, aksi (
action) dijalankan, misal:continue: lanjut ke step berikutnyadrop: hentikan eksekusi job (step berikutnya tidak dijalankan, job dianggap selesai tanpa error)goto_step: lompat ke step tertentugoto_job: lompat ke job tertentufail: tandai job sebagai gagal.
steps:
- name: "check-status"
type: "command"
commands: ["curl -s http://service/health"]
conditions:
- pattern: "OK"
action: "continue"
- pattern: "ERROR"
action: "goto_job"
job: "handle-error"
- pattern: "TIMEOUT"
action: "fail"
- pattern: "RETRY"
action: "goto_step"
step: "check-status"
- pattern: "DROP"
action: "drop"Penjelasan singkat:
- Gunakan
continueuntuk flow normal. - Gunakan
dropuntuk menghentikan job jika output tidak sesuai. - Gunakan
goto_step/goto_jobuntuk branching/loop/error handling.
Field template pada step file_transfer mengontrol apakah file akan di-render dengan variable substitution sebelum di-upload.
- Jika
template: "enabled", maka{{variable}}di dalam file content akan di-replace dengan nilai variable - Jika field
templatetidak didefine, file akan di-upload as-is tanpa rendering - Variable berasal dari execution variables, context variables, atau config variables
File template (config.php):
<?php
$db_host = "{{db_host}}";
$db_name = "{{db_name}}";
$env = "{{environment}}";Pipeline step:
jobs:
- name: deploy
steps:
- name: upload_config
type: file_transfer
source: "config.php"
destination: "/var/www/config.php"
template: "enabled" # ← Enable template renderingExecution variables:
executions:
- name: "Deploy Production"
key: deploy-prod
pipeline: deploy.yaml
variables:
db_host: "prod-db.example.com"
db_name: "myapp_prod"
environment: "production"Hasil file yang di-upload:
<?php
$db_host = "prod-db.example.com";
$db_name = "myapp_prod";
$env = "production";- Template rendering aman dan hanya mengganti text
{{variable}}dengan nilai - Jika variable tidak ditemukan, text
{{variable}}tetap tidak berubah - Untuk file binary (images, JAR, dll), jangan set
template: "enabled" - Gunakan
failuntuk men-trigger fallback/rollback jika terjadi error.
Jika tidak ada conditions yang match dengan output command, Anda bisa menentukan else_action yang akan dijalankan:
steps:
- name: "check-status"
type: "command"
commands: ["curl -s http://service/health"]
conditions:
- pattern: "OK"
action: "continue"
- pattern: "ERROR"
action: "fail"
else_action: "goto_job" # Dijalankan jika tidak OK dan tidak ERROR
else_job: "handle-unknown" # Target job untuk else_actionField Else:
else_action: Action jika tidak ada conditions yang match ("continue", "drop", "goto_step", "goto_job", "fail")else_step: Target step untukelse_action: "goto_step"else_job: Target job untukelse_action: "goto_job"
Untuk workflow CI/CD yang kompleks, fitur ini sangat powerful dan memudahkan automation tanpa perlu scripting tambahan.
silent: true menonaktifkan tampilan output real-time per baris, namun output tetap tersimpan dan bisa ditampilkan di step berikutnya:
jobs:
- name: "test"
steps:
- name: "run-tests"
type: "command"
commands: ["npm test"]
silent: true # No real-time output
save_output: "test_output"
- name: "show-results"
type: "command"
commands: ["echo 'Test Results: {{test_output}}'"]
# Will display the full test output at onceGunakan save_output untuk menyimpan hasil command ke variable yang bisa digunakan di step/job berikutnya:
steps:
- name: "get-version"
type: "command"
commands: ["git rev-parse HEAD"]
save_output: "commit_sha"
- name: "build-image"
type: "command"
commands: ["docker build -t myapp:{{commit_sha}} ."]# List available executions
make-sync pipeline list
# Run specific execution
make-sync pipeline run dev
make-sync pipeline run prod
# Override variables via CLI
make-sync pipeline run prod --var DOCKER_TAG=v1.2.3
make-sync pipeline run dev --var DOCKER_TAG=dev-test --var BUILD_ENV=development
# Dynamic variables untuk CI/CD
make-sync pipeline run prod --var DOCKER_TAG=$(git rev-parse --short HEAD)
make-sync pipeline run dev --var DOCKER_TAG=dev-$(date +%Y%m%d-%H%M%S)Pipeline menampilkan output command secara real-time saat eksekusi, memberikan visibility penuh terhadap progress command yang sedang berjalan:
▶️ EXECUTING JOB: deploy (HEAD)
📋 Executing step: ping-check
Running on 100.96.182.47: ping -c 3 google.com
Command output: PING google.com (216.239.38.120) 56(84) bytes of data.
Command output: 64 bytes from any-in-2678.1e100.net (216.239.38.120): icmp_seq=1 ttl=128 time=30.0 ms
Command output: 64 bytes from any-in-2678.1e100.net (216.239.38.120): icmp_seq=2 ttl=128 time=30.8 ms
Command output: 64 bytes from any-in-2678.1e100.net (216.239.38.120): icmp_seq=3 ttl=128 time=31.1 ms
Command output:
Command output: --- google.com ping statistics ---
Command output: 3 packets transmitted, 3 received, 0% packet loss, time 1998ms
📋 Executing step: deploy-app
Running on 100.96.182.47: docker-compose up -d
Command output: Creating network "myapp_default" with the default driver
Command output: Creating myapp_web_1 ... done
Command output: Creating myapp_db_1 ... done
✅ Completed job: deploy
Untuk command yang verbose, gunakan silent: true untuk menekan output real-time dan tampilkan hasil akhir saja:
steps:
- name: "verbose-command"
type: "command"
commands: ["ping -c 10 google.com"]
silent: true
save_output: "ping_result"
- name: "display-result"
type: "command"
commands: ["echo 'Ping completed: {{ping_result}}'"]Pipeline menampilkan progress eksekusi dengan visual indicators:
▶️ EXECUTING JOB: [name] (HEAD): Job sedang dieksekusi- 📋 Executing step: [name]: Step dalam job sedang berjalan
- ✅ Completed job: [name]: Job berhasil diselesaikan
- ❌ Failed job: [name]: Job gagal
Setiap eksekusi pipeline otomatis mencatat semua output ke file log untuk debugging dan audit trail.
.sync_temp/
└── logs/
├── watcher.log # Application/watcher logs
└── {pipeline-name}-{timestamp}.log # Pipeline execution logs
- Automatic: No configuration required - logs dibuat otomatis saat pipeline run
- Timestamped: Setiap baris dengan format
[YYYY-MM-DD HH:MM:SS] - Clean Output: ANSI escape codes di-strip untuk readability
- Comprehensive: Capture semua stdout/stderr dari command execution
- Persistent: Logs tidak hilang setelah pipeline selesai
make-sync menyimpan ringkasan output terbaru selama eksekusi dalam buffer in-memory berkapasitas 300 KB (307200 bytes). Buffer ini bersifat FIFO: ketika total ukuran semua baris melebihi 300 KB, baris tertua akan di-evict sampai total ukuran kembali di bawah batas. Jika sebuah step gagal (mis. timeout atau error), seluruh isi buffer (hingga batas 300 KB) akan ditulis ke file log pipeline sebagai "error evidence" untuk membantu debugging. Baris tunggal yang lebih besar dari 300 KB tidak otomatis dipotong.
You can control whether a step's real-time output is written into the persistent pipeline log file using the log_output boolean flag. Logging is opt-in and resolved with the following priority (highest → lowest):
- Step-level
log_output - Job-level
log_output - Pipeline-level
log_output
That means a log_output: true set on a Step will enable writing that step's output to the pipeline log even if the Job or Pipeline-level flag is false or unset. Conversely, setting log_output: false on a Step will suppress writing that Step's output even if the Job or Pipeline-level flags are true.
Important notes:
- The in-memory 300 KB error-evidence buffer always captures command output regardless of
log_output. This ensures we can flush recent output on errors even when file logging is disabled for normal runs. log_outputonly controls whether output is written in real time to the pipeline log file and displayed during execution. It does not affect saving output to variables viasave_output.
Example YAML snippets:
Step-level (enable only this step):
steps:
- name: "verbose-step"
type: "command"
commands: ["make test"]
log_output: trueJob-level (enable for all steps in the job unless overridden by a step):
jobs:
- name: "build"
log_output: true
steps:
- name: "run-tests"
type: "command"
commands: ["npm test"]Pipeline-level (default for all jobs/steps in the pipeline unless overridden):
pipeline:
name: "ci"
log_output: false # disable file logging by default; enable selectively via job/stepUse log_output to reduce log noise for very verbose commands, while relying on the in-memory error-evidence buffer to collect recent output in case of failures.
=== Pipeline: deploy-app ===
Started: 2025-10-15-08-30-00
[2025-10-15 08:30:00] ▶️ EXECUTING JOB: prepare (HEAD)
[2025-10-15 08:30:01] Docker version 20.10.7, build f0df350
[2025-10-15 08:30:02] Building image...
[2025-10-15 08:30:15] Successfully built abc123def456
# Review output after execution
tail -f .sync_temp/logs/my-pipeline-*.log
# Search for errors
grep -i "error" .sync_temp/logs/deploy-*.log
# Archive logs for compliance
aws s3 cp .sync_temp/logs/ s3://bucket/pipeline-logs/ --recursivePipeline mendukung variable override langsung dari command line menggunakan flag --var:
# Single variable
make-sync pipeline run [execution_key] --var KEY=value
# Multiple variables
make-sync pipeline run [execution_key] --var KEY1=value1 --var KEY2=value2# Override DOCKER_TAG untuk production
make-sync pipeline run prod --var DOCKER_TAG=v1.2.3
# Override multiple variables
make-sync pipeline run dev --var DOCKER_TAG=dev-test --var BUILD_ENV=development
# Dynamic values untuk CI/CD
make-sync pipeline run prod --var DOCKER_TAG=$(git rev-parse --short HEAD)
make-sync pipeline run staging --var DOCKER_TAG=staging-$(date +%Y%m%d-%H%M%S)
# Useful untuk testing
make-sync pipeline run dev --var DEBUG=true --var LOG_LEVEL=debugPipeline mendukung variable interpolation dengan format {{VAR_NAME}} atau ${{VAR_NAME}}:
- CLI Overrides: Variables dari
--varflag (prioritas tertinggi) - Vars File: Variables dari
vars.yamlberdasarkanexecution.varkey - Global Variables: Didefinisikan di
pipeline.variables - Runtime Variables: Disimpan menggunakan
save_outputdari command
Variable interpolation didukung di field-field berikut:
commands- Command yang akan dieksekusifile- Path file script (untukscripttype)source- Source path (untukfile_transfertype)destination- Destination path (untukfile_transfertype)working_dir- Working directory untuk stepconditions[].pattern- Regex pattern untuk conditional matchingexpect[].response- Response untuk interactive prompts
Selain sistem vars.yaml, Anda juga bisa mendefinisikan variables langsung di execution menggunakan field variables. Fitur ini memberikan fleksibilitas lebih tanpa perlu membuat file vars.yaml terpisah.
executions:
- name: "Development Build"
key: "dev"
pipeline: "my-app.yaml"
variables: # Direct variables definition
DOCKER_TAG: "dev-$(date +%Y%m%d-%H%M%S)"
BUILD_ENV: "development"
DEBUG: "true"
hosts: ["localhost"]1. Menggunakan vars.yaml (sistem lama - tetap didukung)
executions:
- name: "Development Build"
key: "dev"
pipeline: "my-app.yaml"
var: "dev" # Reference ke vars.yaml
hosts: ["localhost"]2. Menggunakan variables langsung (fitur baru)
executions:
- name: "Development Build"
key: "dev"
pipeline: "my-app.yaml"
variables: # Direct definition
DOCKER_TAG: "dev-$(date +%Y%m%d-%H%M%S)"
BUILD_ENV: "development"
hosts: ["localhost"]3. Hybrid approach (kombinasi keduanya)
executions:
- name: "Development Build"
key: "dev"
pipeline: "my-app.yaml"
var: "dev" # Base variables dari vars.yaml
variables: # Override specific variables
DOCKER_TAG: "custom-dev-tag"
NEW_FEATURE: "enabled"
hosts: ["localhost"]- vars.yaml: Ideal untuk shared variables antar executions dan secret management
- variables: Ideal untuk execution-specific overrides dan simple configurations
- hybrid: Ideal untuk complex setups dengan base + customization
steps:
- name: "get-version"
type: "command"
commands: ["echo 'v1.2.3'"]
save_output: "app_version" # Simpan output ke variable
- name: "deploy"
type: "command"
commands: ["echo 'Deploying version {{app_version}}'"] # Gunakan variablesteps:
- name: "check-condition"
type: "command"
commands: ["echo 'SUCCESS'"]
conditions:
- pattern: "SUCCESS"
action: "goto_job"
job: "success_handler"Pipeline disimpan di direktori yang dikonfigurasi di make-sync.yaml:
direct_access:
pipeline_dir: ".sync_pipelines" # Default locationJika pipeline_dir tidak dikonfigurasi, pipeline akan disimpan di working directory saat command dijalankan.
Pipeline menggunakan struktur file berikut:
pipeline_dir/*.yaml: File definisi pipelinepipeline_dir/vars.yaml: Variable global (auto-generated)pipeline_dir/scripts/: Script files untuk eksekusi kompleks
vars atau scripts untuk pipeline karena akan konflik dengan file sistem.
- Tidak ada file yang tertransfer:
- Cek apakah hash sama atau scope/pola tidak match.
- Gagal indexing remote:
- Periksa kredensial SSH, jalur
remote_path, dan izin eksekusi pada binary agent (Unix: chmod +x).
- Periksa kredensial SSH, jalur
- Pola
!patterntidak bekerja:- Pastikan
.sync_ignoreada di root lokal, setiap pattern pada baris terpisah, tanpa komentar. Gunakan**/untuk menjangkau subfolder jika perlu.
- Pastikan
Proyek ini mengikuti lisensi yang ditentukan oleh pemilik repositori.