Compare commits
13
Commits
f06a8fc205
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
341faec48b | ||
|
|
077c9a6253 | ||
|
|
811f9ee741 | ||
|
|
04d48abc85 | ||
|
|
e7932a2239 | ||
|
|
018ec9a694 | ||
|
|
674941939c | ||
|
|
2e4315dc68 | ||
|
|
17604e5f80 | ||
|
|
b924b0ea8e | ||
|
|
f62fd389b7 | ||
|
|
28c13399f4 | ||
|
|
97bd62fd47 |
@@ -0,0 +1,70 @@
|
||||
name: CI/CD Pipeline to Rancher - SIDATA
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# ============================================================
|
||||
# Checkout
|
||||
# ============================================================
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# ============================================================
|
||||
# Login Registry
|
||||
# ============================================================
|
||||
- name: Log in to Gitea Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: registry-bpkd.drc-bpkd.data-center.id
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
# ============================================================
|
||||
# Build & Push
|
||||
# ============================================================
|
||||
- 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 }}
|
||||
|
||||
# ============================================================
|
||||
# Deploy ke Rancher
|
||||
# ============================================================
|
||||
- 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"
|
||||
|
||||
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 }}"
|
||||
|
||||
./
|
||||
@@ -0,0 +1,16 @@
|
||||
/node_modules
|
||||
/public/hot
|
||||
/public/storage
|
||||
/public/uploadFiles
|
||||
/public/downloadFiles
|
||||
/storage/*.key
|
||||
.env
|
||||
.env.backup
|
||||
.phpunit.result.cache
|
||||
docker-compose.override.yml
|
||||
Homestead.json
|
||||
Homestead.yaml
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
/.idea
|
||||
/.vscode
|
||||
+4
-11
@@ -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 https_proxy
|
||||
@@ -57,16 +57,12 @@ RUN chown -R www-data:www-data /var/www/html \
|
||||
&& chmod -R 775 /var/www/html/storage \
|
||||
&& chmod -R 775 /var/www/html/bootstrap/cache
|
||||
|
||||
# Konfigurasi Nginx presisi untuk subpath /sidata dan PHP-FPM
|
||||
# Konfigurasi Nginx Standar Laravel (Merespons di Root /)
|
||||
RUN echo 'server { \
|
||||
listen 80; \
|
||||
index index.php index.html; \
|
||||
root /var/www/html/public; \
|
||||
\
|
||||
location /sidata { \
|
||||
try_files $uri $uri/ /sidata/index.php?$query_string; \
|
||||
} \
|
||||
\
|
||||
location / { \
|
||||
try_files $uri $uri/ /index.php?$query_string; \
|
||||
} \
|
||||
@@ -75,14 +71,11 @@ RUN echo 'server { \
|
||||
fastcgi_pass 127.0.0.1:9000; \
|
||||
fastcgi_index index.php; \
|
||||
include fastcgi_params; \
|
||||
fastcgi_param SCRIPT_FILENAME /var/www/html/public/index.php; \
|
||||
fastcgi_param SCRIPT_NAME $fastcgi_script_name; \
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; \
|
||||
} \
|
||||
}' > /etc/nginx/sites-available/default
|
||||
|
||||
# ... (bagian atas Dockerfile tetap sama) ...
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
# Script startup: Buat .env dari variabel environment Helm jika .env belum ada, lalu jalankan service
|
||||
# Script startup: Buat .env dari variabel environment Helm, lalu jalankan service
|
||||
CMD ["sh", "-c", "env | grep -E '^(APP_|DB_|MYSQL_|ORA_|REDIS_|MAIL_|SESSION_|SOA_)' > /var/www/html/.env && redis-server --daemonize yes && php-fpm -D && exec nginx -g 'daemon off;'"]
|
||||
@@ -16,7 +16,7 @@ class Authenticate extends Middleware
|
||||
{
|
||||
if (! $request->expectsJson()) {
|
||||
// Paksa redirect membawa prefix /sidata agar tidak terlempar ke root domain
|
||||
return url('/sidata/login');
|
||||
return redirect()->guest(route('login'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,22 +2,13 @@
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Http\Middleware\TrustProxies as Middleware;
|
||||
use Illuminate\Http\Request;
|
||||
use Fideloper\Proxy\TrustProxies as Middleware;
|
||||
|
||||
class TrustProxies extends Middleware
|
||||
{
|
||||
/**
|
||||
* The trusted proxies for this application.
|
||||
*
|
||||
* @var array|string|null
|
||||
*/
|
||||
protected $proxies = '*';
|
||||
|
||||
/**
|
||||
* The headers that should be used to detect proxies.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $headers = Request::HEADER_X_FORWARDED_ALL;
|
||||
protected $headers = [
|
||||
\Illuminate\Http\Request::HEADER_X_FORWARDED_ALL,
|
||||
];
|
||||
}
|
||||
@@ -17,7 +17,7 @@ class RouteServiceProvider extends ServiceProvider
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const HOME = '/sidata/home';
|
||||
public const HOME = '/home';
|
||||
|
||||
/**
|
||||
* The controller namespace for the application.
|
||||
|
||||
Submodule
+1
Submodule gitea-test added at 6b0ee8ee4b
@@ -6,4 +6,4 @@
|
||||
# spec:
|
||||
# stripPrefix:
|
||||
# prefixes:
|
||||
# - /sidata
|
||||
# - /sidataprod
|
||||
@@ -13,14 +13,16 @@ service:
|
||||
|
||||
ingress:
|
||||
enabled: true
|
||||
className: nginx
|
||||
className: traefik
|
||||
annotations:
|
||||
# HAPUS rewrite-target agar URL /sidata diteruskan utuh ke Pod
|
||||
# Nginx di dalam Pod kita sudah punya 'location /sidata'
|
||||
nginx.ingress.kubernetes.io/ssl-redirect: "false"
|
||||
host: dashboard-bpkd.drc-bpkd.data-center.id
|
||||
path: /sidata
|
||||
pathType: Prefix
|
||||
traefik.ingress.kubernetes.io/router.middlewares: sidata-prod-fix-sidata-prefix@kubernetescrd
|
||||
traefik.ingress.kubernetes.io/service.sticky.cookie: "true"
|
||||
traefik.ingress.kubernetes.io/service.sticky.cookie.name: SIDATA_STICKY
|
||||
hosts:
|
||||
- host: dashboard-bpkd.drc-bpkd.data-center.id
|
||||
paths:
|
||||
- path: /sidata
|
||||
pathType: Prefix
|
||||
|
||||
env:
|
||||
APP_NAME: "SIDATA"
|
||||
|
||||
Vendored
Executable → Regular
Vendored
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Reference in New Issue
Block a user