4 Commits
Author SHA1 Message Date
gitea 96619ca480 test small push 2026-09-06 09:57:25 +07:00
gitea b9f3ce7bb8 test docker runner 2026-09-06 09:31:06 +07:00
gitea 8d809109de debug: small ssh push 2026-09-05 21:42:43 +07:00
gitea 39184a8a52 test gitea receive 2026-09-05 21:15:33 +07:00
12 changed files with 89 additions and 70 deletions
+24 -43
View File
@@ -1,70 +1,51 @@
name: CI/CD Pipeline to Rancher - SIDATA
on:
push:
branches:
- main
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
# ============================================================
# Checkout
# ============================================================
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
# ============================================================
# Login Registry
# ============================================================
# Login ke Registry Gitea Lokal
- name: Log in to Gitea Container Registry
uses: docker/login-action@v2
with:
registry: registry-bpkd.drc-bpkd.data-center.id
registry: 10.15.39.187:3000
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
# ============================================================
# Build & Push
# ============================================================
# Build & Push Image Aplikasi SIDATA ke Registry
- name: Build and Push Docker Image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
registry-bpkd.drc-bpkd.data-center.id/${{ secrets.REGISTRY_USER }}/sidata:latest
registry-bpkd.drc-bpkd.data-center.id/${{ secrets.REGISTRY_USER }}/sidata:${{ gitea.sha }}
10.15.39.187:3000/${{ secrets.REGISTRY_USER }}/sidata:latest
10.15.39.187:3000/${{ secrets.REGISTRY_USER }}/sidata:${{ gitea.sha }}
# ============================================================
# Deploy ke Rancher
# ============================================================
# Deploy & Update Workload di Cluster Local Rancher BPKD
- name: Deploy to Rancher Cluster
shell: bash
run: |
set -e
echo "=== Download kubectl ==="
KUBECTL_VERSION=$(curl -L -s https://dl.k8s.io/release/stable.txt)
curl -fLO \
"https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl"
# Download binary kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
echo "kubectl version:"
./kubectl version --client
# Set Kubeconfig menggunakan API Rancher BPKD
./kubectl config set-cluster rancher-cluster --server=${{ secrets.RANCHER_URL }}/k8s/clusters/${{ secrets.RANCHER_CLUSTER_ID }} --insecure-skip-tls-verify=true
./kubectl config set-credentials rancher-user --token=${{ secrets.RANCHER_TOKEN }}
./kubectl config set-context rancher-context --cluster=rancher-cluster --user=rancher-user
./kubectl config use-context rancher-context
echo "=== Configure Rancher Kubeconfig ==="
# Update Container Image untuk Workload sidata
# Sesuaikan 'sidata-deployment', 'sidata-container', dan namespace jika berbeda di Rancher
./kubectl set image deployment/sidata-deployment sidata-container=10.15.39.187:3000/${{ secrets.REGISTRY_USER }}/sidata:${{ gitea.sha }} -n sidataprod
./kubectl config set-cluster rancher-cluster \
--server="${{ secrets.RANCHER_URL }}/k8s/clusters/${{ secrets.RANCHER_CLUSTER_ID }}" \
--insecure-skip-tls-verify=true
./kubectl config set-credentials rancher-user \
--token="${{ secrets.RANCHER_TOKEN }}"
./
# Pantau Status Rollout hingga Sukses
./kubectl rollout status deployment/sidata-deployment -n sidataprod
+27
View File
@@ -0,0 +1,27 @@
name: Docker Test
on:
workflow_dispatch:
jobs:
docker-test:
runs-on: ubuntu-latest
steps:
- name: Check Docker
run: |
docker version
docker info
- name: Test Docker Build
run: |
mkdir test-image
cd test-image
cat > Dockerfile <<'EOF'
FROM alpine:latest
CMD ["echo", "Docker runner works!"]
EOF
docker build -t test-runner:latest .
docker run --rm test-runner:latest
+1 -1
View File
@@ -1,4 +1,4 @@
FROM registry-nexus-bpkd.drc-bpkd.data-center.id/php74-fpm-oci8-lengkap:1.0
FROM 10.15.39.186:8083/php74-fpm-oci8-lengkap:1.0
ARG http_proxy
ARG https_proxy
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -16,7 +16,7 @@ class Authenticate extends Middleware
{
if (! $request->expectsJson()) {
// Paksa redirect membawa prefix /sidata agar tidak terlempar ke root domain
return redirect()->guest(route('login'));
return url('/sidata/login');
}
}
}
+13 -4
View File
@@ -2,13 +2,22 @@
namespace App\Http\Middleware;
use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array|string|null
*/
protected $proxies = '*';
protected $headers = [
\Illuminate\Http\Request::HEADER_X_FORWARDED_ALL,
];
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_ALL;
}
+1 -1
View File
@@ -17,7 +17,7 @@ class RouteServiceProvider extends ServiceProvider
*
* @var string
*/
public const HOME = '/home';
public const HOME = '/sidata/home';
/**
* The controller namespace for the application.
+1
View File
@@ -0,0 +1 @@
gitea debug 09/05/2026 21:15:33
+1
View File
@@ -0,0 +1 @@
hello
+1
View File
@@ -0,0 +1 @@
test gitea small push
Submodule gitea-test deleted from 6b0ee8ee4b
+1 -1
View File
@@ -6,4 +6,4 @@
# spec:
# stripPrefix:
# prefixes:
# - /sidataprod
# - /sidata