Compare commits
7
Commits
debug-small
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
341faec48b | ||
|
|
077c9a6253 | ||
|
|
811f9ee741 | ||
|
|
04d48abc85 | ||
|
|
e7932a2239 | ||
|
|
018ec9a694 | ||
|
|
674941939c |
@@ -1,51 +1,70 @@
|
|||||||
name: CI/CD Pipeline to Rancher - SIDATA
|
name: CI/CD Pipeline to Rancher - SIDATA
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
|
||||||
- name: Checkout Code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
# Login ke Registry Gitea Lokal
|
steps:
|
||||||
- name: Log in to Gitea Container Registry
|
# ============================================================
|
||||||
uses: docker/login-action@v2
|
# Checkout
|
||||||
with:
|
# ============================================================
|
||||||
registry: 10.15.39.187:3000
|
- name: Checkout Code
|
||||||
username: ${{ secrets.REGISTRY_USER }}
|
uses: actions/checkout@v3
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
||||||
|
|
||||||
# Build & Push Image Aplikasi SIDATA ke Registry
|
# ============================================================
|
||||||
- name: Build and Push Docker Image
|
# Login Registry
|
||||||
uses: docker/build-push-action@v4
|
# ============================================================
|
||||||
with:
|
- name: Log in to Gitea Container Registry
|
||||||
context: .
|
uses: docker/login-action@v2
|
||||||
push: true
|
with:
|
||||||
tags: |
|
registry: registry-bpkd.drc-bpkd.data-center.id
|
||||||
10.15.39.187:3000/${{ secrets.REGISTRY_USER }}/sidata:latest
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
10.15.39.187:3000/${{ secrets.REGISTRY_USER }}/sidata:${{ gitea.sha }}
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
# Deploy & Update Workload di Cluster Local Rancher BPKD
|
# ============================================================
|
||||||
- name: Deploy to Rancher Cluster
|
# Build & Push
|
||||||
run: |
|
# ============================================================
|
||||||
# Download binary kubectl
|
- name: Build and Push Docker Image
|
||||||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
uses: docker/build-push-action@v4
|
||||||
chmod +x kubectl
|
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 }}
|
||||||
|
|
||||||
# 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
|
# Deploy ke Rancher
|
||||||
./kubectl config set-credentials rancher-user --token=${{ secrets.RANCHER_TOKEN }}
|
# ============================================================
|
||||||
./kubectl config set-context rancher-context --cluster=rancher-cluster --user=rancher-user
|
- name: Deploy to Rancher Cluster
|
||||||
./kubectl config use-context rancher-context
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
|
||||||
# Update Container Image untuk Workload sidata
|
echo "=== Download kubectl ==="
|
||||||
# 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
|
|
||||||
|
|
||||||
# Pantau Status Rollout hingga Sukses
|
KUBECTL_VERSION=$(curl -L -s https://dl.k8s.io/release/stable.txt)
|
||||||
./kubectl rollout status deployment/sidata-deployment -n sidataprod
|
|
||||||
|
curl -fLO \
|
||||||
|
"https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl"
|
||||||
|
|
||||||
|
chmod +x kubectl
|
||||||
|
|
||||||
|
echo "kubectl version:"
|
||||||
|
./kubectl version --client
|
||||||
|
|
||||||
|
echo "=== Configure Rancher Kubeconfig ==="
|
||||||
|
|
||||||
|
./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 }}"
|
||||||
|
|
||||||
|
./
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
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
|
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
FROM 10.15.39.186:8083/php74-fpm-oci8-lengkap:1.0
|
FROM registry-nexus-bpkd.drc-bpkd.data-center.id/php74-fpm-oci8-lengkap:1.0
|
||||||
|
|
||||||
ARG http_proxy
|
ARG http_proxy
|
||||||
ARG https_proxy
|
ARG https_proxy
|
||||||
@@ -48,7 +48,7 @@ RUN if [ ! -f .env ]; then \
|
|||||||
if [ -f .env.example ]; then \
|
if [ -f .env.example ]; then \
|
||||||
cp .env.example .env; \
|
cp .env.example .env; \
|
||||||
else \
|
else \
|
||||||
echo "APP_NAME=Sidata\nAPP_ENV=production\nAPP_KEY=\nAPP_DEBUG=false\nAPP_URL=https://dashboard-bpkd.drc-bpkd.data-center.id/sidataprod" > .env; \
|
echo "APP_NAME=Sidata\nAPP_ENV=production\nAPP_KEY=\nAPP_DEBUG=true\nAPP_URL=https://dashboard-bpkd.drc-bpkd.data-center.id/sidata" > .env; \
|
||||||
fi \
|
fi \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class Authenticate extends Middleware
|
|||||||
{
|
{
|
||||||
if (! $request->expectsJson()) {
|
if (! $request->expectsJson()) {
|
||||||
// Paksa redirect membawa prefix /sidata agar tidak terlempar ke root domain
|
// Paksa redirect membawa prefix /sidata agar tidak terlempar ke root domain
|
||||||
return url('/sidataprod/login');
|
return redirect()->guest(route('login'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,22 +2,13 @@
|
|||||||
|
|
||||||
namespace App\Http\Middleware;
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
use Illuminate\Http\Middleware\TrustProxies as Middleware;
|
use Fideloper\Proxy\TrustProxies as Middleware;
|
||||||
use Illuminate\Http\Request;
|
|
||||||
|
|
||||||
class TrustProxies extends Middleware
|
class TrustProxies extends Middleware
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* The trusted proxies for this application.
|
|
||||||
*
|
|
||||||
* @var array|string|null
|
|
||||||
*/
|
|
||||||
protected $proxies = '*';
|
protected $proxies = '*';
|
||||||
|
|
||||||
/**
|
protected $headers = [
|
||||||
* The headers that should be used to detect proxies.
|
\Illuminate\Http\Request::HEADER_X_FORWARDED_ALL,
|
||||||
*
|
];
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
protected $headers = Request::HEADER_X_FORWARDED_ALL;
|
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,7 @@ class RouteServiceProvider extends ServiceProvider
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const HOME = '/sidataprod/home';
|
public const HOME = '/home';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The controller namespace for the application.
|
* The controller namespace for the application.
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
gitea debug 09/05/2026 21:15:33
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
hello
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
test gitea small push
|
|
||||||
Submodule
+1
Submodule gitea-test added at 6b0ee8ee4b
@@ -1,9 +1,9 @@
|
|||||||
apiVersion: traefik.io/v1alpha1
|
#apiVersion: traefik.io/v1alpha1
|
||||||
kind: Middleware
|
#kind: Middleware
|
||||||
metadata:
|
#metadata:
|
||||||
name: fix-sidata-prefix
|
# name: fix-sidata-prefix
|
||||||
namespace: sidata-prod
|
# namespace: sidata-prod
|
||||||
spec:
|
# spec:
|
||||||
stripPrefix:
|
# stripPrefix:
|
||||||
prefixes:
|
# prefixes:
|
||||||
- /sidataprod
|
# - /sidataprod
|
||||||
@@ -21,7 +21,7 @@ ingress:
|
|||||||
hosts:
|
hosts:
|
||||||
- host: dashboard-bpkd.drc-bpkd.data-center.id
|
- host: dashboard-bpkd.drc-bpkd.data-center.id
|
||||||
paths:
|
paths:
|
||||||
- path: /sidataprod
|
- path: /sidata
|
||||||
pathType: Prefix
|
pathType: Prefix
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@@ -29,9 +29,9 @@ env:
|
|||||||
APP_ENV: "production"
|
APP_ENV: "production"
|
||||||
APP_KEY: "base64:JWoCrp63f8mipgiOWhwpIG+YVpw1Lunn4RZf0mcBWNg="
|
APP_KEY: "base64:JWoCrp63f8mipgiOWhwpIG+YVpw1Lunn4RZf0mcBWNg="
|
||||||
APP_DEBUG: "false"
|
APP_DEBUG: "false"
|
||||||
APP_URL: "https://dashboard-bpkd.drc-bpkd.data-center.id/sidataprod"
|
APP_URL: "https://dashboard-bpkd.drc-bpkd.data-center.id/sidata"
|
||||||
# ASSET_URL MEMASTIKAN CSS/JS TETAP MEMILIKI PREFIX /sidata
|
# ASSET_URL MEMASTIKAN CSS/JS TETAP MEMILIKI PREFIX /sidata
|
||||||
ASSET_URL: "https://dashboard-bpkd.drc-bpkd.data-center.id/sidataprod"
|
ASSET_URL: "https://dashboard-bpkd.drc-bpkd.data-center.id/sidata"
|
||||||
LOG_CHANNEL: "stack"
|
LOG_CHANNEL: "stack"
|
||||||
LOG_LEVEL: "debug"
|
LOG_LEVEL: "debug"
|
||||||
MYSQL_CONNECTION: "mysql"
|
MYSQL_CONNECTION: "mysql"
|
||||||
|
|||||||
Reference in New Issue
Block a user