Skip to content

Instantly share code, notes, and snippets.

@wuriyanto48
Created August 6, 2025 09:22
Show Gist options
  • Select an option

  • Save wuriyanto48/7537fcb48cbd53a86473f2570f91448d to your computer and use it in GitHub Desktop.

Select an option

Save wuriyanto48/7537fcb48cbd53a86473f2570f91448d to your computer and use it in GitHub Desktop.

Revisions

  1. wuriyanto48 created this gist Aug 6, 2025.
    64 changes: 64 additions & 0 deletions cicd.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,64 @@
    #!/bin/bash

    set -e

    function checkout_code() {
    echo "πŸ“₯ [Checkout] Mengambil source code dari repository..."
    sleep 1
    }

    function install_dependencies() {
    echo "πŸ“¦ [Install] Menginstal dependensi project..."
    sleep 1
    }

    function run_linter() {
    echo "🧹 [Lint] Mengecek kode dengan linter..."
    sleep 1
    }

    function run_tests() {
    echo "πŸ§ͺ [Test] Menjalankan unit tests..."
    sleep 1
    }

    function build_project() {
    echo "πŸ—οΈ [Build] Membangun project..."
    sleep 1
    }

    function deploy_to_staging() {
    echo "πŸš€ [Deploy] Men-deploy ke lingkungan staging..."
    sleep 1
    }

    function run_integration_tests() {
    echo "πŸ”— [Integration Test] Menjalankan integration tests..."
    sleep 1
    }

    function deploy_to_production() {
    echo "πŸš€ [Deploy] Men-deploy ke lingkungan production..."
    sleep 1
    }

    function notify() {
    echo "πŸ“’ [Notify] Mengirim notifikasi ke tim..."
    sleep 1
    }

    function main() {
    echo "===== Simulasi CI/CD Dimulai ====="
    checkout_code
    install_dependencies
    run_linter
    run_tests
    build_project
    deploy_to_staging
    run_integration_tests
    deploy_to_production
    notify
    echo "===== Simulasi CI/CD Selesai ====="
    }

    main