Rebuild
This commit is contained in:
parent
15b1e8af19
commit
b811249815
@ -1,36 +0,0 @@
|
|||||||
stages:
|
|
||||||
- build
|
|
||||||
- deploy
|
|
||||||
|
|
||||||
variables:
|
|
||||||
IMAGE_NAME: purwakarta-diskominfo-simedkom
|
|
||||||
IMAGE_TAG: v1.0.1
|
|
||||||
CONTAINER_NAME: purwakarta-diskominfo-simedkom
|
|
||||||
DOCKER_REGISTRY: registry.mango.local
|
|
||||||
DOCKER_IMAGE_FULL_PATH: $DOCKER_REGISTRY/pratama/$IMAGE_NAME:$IMAGE_TAG
|
|
||||||
DOCKER_DRIVER: overlay2
|
|
||||||
|
|
||||||
build:
|
|
||||||
stage: build
|
|
||||||
image: docker:latest
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
services:
|
|
||||||
- docker:dind
|
|
||||||
script:
|
|
||||||
# - docker login -u $DOCKER_REGISTRY_USER -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY
|
|
||||||
- docker build -t $IMAGE_NAME:$IMAGE_TAG .
|
|
||||||
- docker tag $IMAGE_NAME:$IMAGE_TAG $DOCKER_IMAGE_FULL_PATH
|
|
||||||
- docker push $DOCKER_IMAGE_FULL_PATH
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
stage: deploy
|
|
||||||
image: docker:latest
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
services:
|
|
||||||
- docker:dind
|
|
||||||
script:
|
|
||||||
- docker compose down || true
|
|
||||||
- docker compose build
|
|
||||||
- docker compose up -d --build
|
|
||||||
34
Dockerfile
34
Dockerfile
@ -1,34 +0,0 @@
|
|||||||
FROM dunglas/frankenphp:1.1-php8.2
|
|
||||||
|
|
||||||
ENV SERVER_NAME=:80
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Install extension yang dibutuhkan Laravel
|
|
||||||
RUN apt-get update && apt-get install -y \
|
|
||||||
git \
|
|
||||||
unzip \
|
|
||||||
zip \
|
|
||||||
curl \
|
|
||||||
libzip-dev \
|
|
||||||
libpng-dev \
|
|
||||||
libjpeg-dev \
|
|
||||||
libfreetype6-dev \
|
|
||||||
pkg-config \
|
|
||||||
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
|
||||||
&& docker-php-ext-install zip pdo pdo_mysql gd bcmath \
|
|
||||||
&& apt-get clean \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
|
|
||||||
# Install composer
|
|
||||||
RUN curl -sS https://getcomposer.org/installer | php && \
|
|
||||||
mv composer.phar /usr/local/bin/composer
|
|
||||||
|
|
||||||
COPY . /app
|
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
|
||||||
|
|
||||||
RUN chmod +x /entrypoint.sh
|
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
|
||||||
@ -18,193 +18,194 @@
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// if(env('FILESYSTEM_DISK') === 's3'){
|
// if(env('FILESYSTEM_DISK') === 's3'){
|
||||||
// if (! function_exists('store_file')) {
|
// if (! function_exists('store_file')) {
|
||||||
// function store_file($file = null, $path, $disk = null)
|
// function store_file($file = null, $path, $disk = null)
|
||||||
// {
|
// {
|
||||||
// $disk = $disk ?? env('FILESYSTEM_DISK', 'public');
|
// $disk = $disk ?? env('FILESYSTEM_DISK', 'public');
|
||||||
|
|
||||||
// if (filled($file) && $file instanceof \Illuminate\Http\UploadedFile) {
|
// if (filled($file) && $file instanceof \Illuminate\Http\UploadedFile) {
|
||||||
// $randomFilename = Str::random(35) . time() . '.' . $file->getClientOriginalExtension();
|
// $randomFilename = Str::random(35) . time() . '.' . $file->getClientOriginalExtension();
|
||||||
// $originalFileName = Str::slug(pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME)) . '.' . $file->getClientOriginalExtension();
|
// $originalFileName = Str::slug(pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME)) . '.' . $file->getClientOriginalExtension();
|
||||||
|
|
||||||
// $stored = $file->storeAs($path, $randomFilename, $disk);
|
// $stored = $file->storeAs($path, $randomFilename, $disk);
|
||||||
|
|
||||||
// if ($stored) {
|
// if ($stored) {
|
||||||
// $url = Storage::disk($disk)->url($stored);
|
// $url = Storage::disk($disk)->url($stored);
|
||||||
|
|
||||||
// return [
|
// return [
|
||||||
// 'randomFileName' => $randomFilename,
|
// 'randomFileName' => $randomFilename,
|
||||||
// 'originalFileName' => $originalFileName,
|
// 'originalFileName' => $originalFileName,
|
||||||
// 'url' => $url,
|
// 'url' => $url,
|
||||||
// 'isSuccess' => true,
|
// 'isSuccess' => true,
|
||||||
// ];
|
// ];
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// return [
|
// return [
|
||||||
// 'randomFileName' => null,
|
// 'randomFileName' => null,
|
||||||
// 'originalFileName' => null,
|
// 'originalFileName' => null,
|
||||||
// 'url' => null,
|
// 'url' => null,
|
||||||
// 'isSuccess' => false,
|
// 'isSuccess' => false,
|
||||||
// ];
|
// ];
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// if (!function_exists('display_file')) {
|
// if (!function_exists('display_file')) {
|
||||||
// function display_file($dir, $filename, $disk = null, $expirationMinutes = 60): string
|
// function display_file($dir, $filename, $disk = null, $expirationMinutes = 60): string
|
||||||
// {
|
// {
|
||||||
// $disk = $disk ?? env('FILESYSTEM_DISK', 'public');
|
// $disk = $disk ?? env('FILESYSTEM_DISK', 'public');
|
||||||
|
|
||||||
// if (!filled($filename)) {
|
// if (!filled($filename)) {
|
||||||
// return '<p class="text-center">Belum ditambahkan.</p>';
|
// return '<p class="text-center">Belum ditambahkan.</p>';
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// $path = "uploads/{$dir}/{$filename}";
|
// $path = "uploads/{$dir}/{$filename}";
|
||||||
|
|
||||||
// try {
|
// try {
|
||||||
// $fileExists = is_file_exists($path, $disk);
|
// $fileExists = is_file_exists($path, $disk);
|
||||||
|
|
||||||
// if (!$fileExists) {
|
// if (!$fileExists) {
|
||||||
// return '<p class="text-center">File tidak ditemukan.</p>';
|
// return '<p class="text-center">File tidak ditemukan.</p>';
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// if ($disk === 's3') {
|
// if ($disk === 's3') {
|
||||||
// $fileUrl = Storage::disk($disk)->temporaryUrl($path, now()->addMinutes($expirationMinutes));
|
// $fileUrl = Storage::disk($disk)->temporaryUrl($path, now()->addMinutes($expirationMinutes));
|
||||||
// } else {
|
// } else {
|
||||||
// $fileUrl = Storage::disk($disk)->url($path);
|
// $fileUrl = Storage::disk($disk)->url($path);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// $ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
|
// $ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
|
||||||
// $mimeType = match ($ext) {
|
// $mimeType = match ($ext) {
|
||||||
// 'jpg', 'jpeg', 'png', 'gif', 'webp' => 'image/' . $ext,
|
// 'jpg', 'jpeg', 'png', 'gif', 'webp' => 'image/' . $ext,
|
||||||
// 'pdf' => 'application/pdf',
|
// 'pdf' => 'application/pdf',
|
||||||
// default => 'unknown',
|
// default => 'unknown',
|
||||||
// };
|
// };
|
||||||
|
|
||||||
// if (str_contains($mimeType, 'image')) {
|
// if (str_contains($mimeType, 'image')) {
|
||||||
// return "<img src='{$fileUrl}' alt='File Image' class='img-fluid'>";
|
// return "<img src='{$fileUrl}' alt='File Image' class='img-fluid'>";
|
||||||
// } elseif ($mimeType === 'application/pdf') {
|
// } elseif ($mimeType === 'application/pdf') {
|
||||||
// return "<iframe src='{$fileUrl}' width='100%' height='600px'></iframe>";
|
// return "<iframe src='{$fileUrl}' width='100%' height='600px'></iframe>";
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// return '<p class="text-center">Format file tidak didukung</p>';
|
// return '<p class="text-center">Format file tidak didukung</p>';
|
||||||
// } catch (\Exception $e) {
|
// } catch (\Exception $e) {
|
||||||
// return '<p class="text-center text-danger">Terjadi kesalahan saat menampilkan file.</p>';
|
// return '<p class="text-center text-danger">Terjadi kesalahan saat menampilkan file.</p>';
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// if (! function_exists('delete_file')) {
|
// if (! function_exists('delete_file')) {
|
||||||
// function delete_file($path, $disk = null): bool
|
// function delete_file($path, $disk = null): bool
|
||||||
// {
|
// {
|
||||||
// $disk = $disk ?? env('FILESYSTEM_DISK', 'public');
|
// $disk = $disk ?? env('FILESYSTEM_DISK', 'public');
|
||||||
|
|
||||||
// try {
|
// try {
|
||||||
// if(is_file_exists($path)){
|
// if(is_file_exists($path)){
|
||||||
// return Storage::disk($disk)->delete($path);
|
// return Storage::disk($disk)->delete($path);
|
||||||
// }else{
|
// }else{
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
// } catch (\Exception $e) {
|
// } catch (\Exception $e) {
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// if (!function_exists('is_file_exists')) {
|
// if (!function_exists('is_file_exists')) {
|
||||||
// function is_file_exists($path, $disk = null): bool
|
// function is_file_exists($path, $disk = null): bool
|
||||||
// {
|
// {
|
||||||
// $disk = $disk ?? env('FILESYSTEM_DISK', 'public');
|
// $disk = $disk ?? env('FILESYSTEM_DISK', 'public');
|
||||||
|
|
||||||
// try {
|
// try {
|
||||||
// $file = Storage::disk($disk)->get($path);
|
// $file = Storage::disk($disk)->get($path);
|
||||||
// return !empty($file);
|
// return !empty($file);
|
||||||
// } catch (\Throwable $e) {
|
// } catch (\Throwable $e) {
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }else if(env('FILESYSTEM_DISK') === 'local'){
|
// }else if(env('FILESYSTEM_DISK') === 'local'){
|
||||||
if (! function_exists('store_file')) {
|
if (! function_exists('store_file')) {
|
||||||
function store_file($file = null, $path, $disk = 'public')
|
function store_file($file = null, $path = null, $disk = 'public')
|
||||||
{
|
{
|
||||||
if (filled($file) && $file && $file instanceof \Illuminate\Http\UploadedFile) {
|
if (filled($file) && $file && $file instanceof \Illuminate\Http\UploadedFile) {
|
||||||
$randomFilename = Str::random(35).time().'.'.$file->getClientOriginalExtension();
|
$randomFilename = Str::random(35) . time() . '.' . $file->getClientOriginalExtension();
|
||||||
$originalFileName = Str::slug(pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME)).'.'.$file->getClientOriginalExtension();
|
$originalFileName = Str::slug(pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME)) . '.' . $file->getClientOriginalExtension();
|
||||||
|
|
||||||
$file->storeAs($path, $randomFilename, $disk);
|
$file->storeAs($path, $randomFilename, $disk);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'randomFileName' => $randomFilename,
|
'randomFileName' => $randomFilename,
|
||||||
'originalFileName' => $originalFileName,
|
'originalFileName' => $originalFileName,
|
||||||
'isSuccess' => true,
|
'isSuccess' => true,
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
return [
|
return [
|
||||||
'randomFileName' => null,
|
'randomFileName' => null,
|
||||||
'originalFileName' => null,
|
'originalFileName' => null,
|
||||||
'isSuccess' => false,
|
'isSuccess' => false,
|
||||||
];
|
];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!function_exists('display_file')) {
|
if (!function_exists('display_file')) {
|
||||||
function display_file($dir, $filename)
|
function display_file($dir, $filename)
|
||||||
{
|
{
|
||||||
$path = storage_path("app/public/uploads/{$dir}/{$filename}");
|
$path = storage_path("app/public/uploads/{$dir}/{$filename}");
|
||||||
|
|
||||||
if(!filled($filename)){
|
if (!filled($filename)) {
|
||||||
return '<p class="text-center">Belum ditambahkan.</p>';
|
return '<p class="text-center">Belum ditambahkan.</p>';
|
||||||
}
|
|
||||||
|
|
||||||
if (!file_exists($path)) {
|
|
||||||
return '<p class="text-center">File tidak ditemukan.</p>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$mimeType = mime_content_type($path);
|
|
||||||
$fileUrl = asset("storage/uploads/{$dir}/{$filename}");
|
|
||||||
|
|
||||||
if (str_contains($mimeType, 'image')) {
|
|
||||||
return "<img src='{$fileUrl}' alt='File Image' class='img-fluid'>";
|
|
||||||
} elseif ($mimeType === 'application/pdf') {
|
|
||||||
return "<iframe src='{$fileUrl}' width='100%' height='600px'></iframe>";
|
|
||||||
}
|
|
||||||
|
|
||||||
return '<p class="text-center">Format file tidak didukung</p>';
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (! function_exists('delete_file')) {
|
if (!file_exists($path)) {
|
||||||
function delete_file($path)
|
return '<p class="text-center">File tidak ditemukan.</p>';
|
||||||
{
|
|
||||||
// Menggunakan public_path untuk file yang berada di dalam storage/public
|
|
||||||
$fullPath = public_path('storage/' . $path);
|
|
||||||
|
|
||||||
if (File::exists($fullPath)) {
|
|
||||||
File::delete($fullPath);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (! function_exists('is_file_exists')) {
|
$mimeType = mime_content_type($path);
|
||||||
function is_file_exists($path)
|
$fileUrl = asset("storage/uploads/{$dir}/{$filename}");
|
||||||
{
|
|
||||||
return File::exists(public_path('storage/' . $path));
|
if (str_contains($mimeType, 'image')) {
|
||||||
|
return "<img src='{$fileUrl}' alt='File Image' class='img-fluid'>";
|
||||||
|
} elseif ($mimeType === 'application/pdf') {
|
||||||
|
return "<iframe src='{$fileUrl}' width='100%' height='600px'></iframe>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return '<p class="text-center">Format file tidak didukung</p>';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! function_exists('delete_file')) {
|
||||||
|
function delete_file($path)
|
||||||
|
{
|
||||||
|
// Menggunakan public_path untuk file yang berada di dalam storage/public
|
||||||
|
$fullPath = public_path('storage/' . $path);
|
||||||
|
|
||||||
|
if (File::exists($fullPath)) {
|
||||||
|
File::delete($fullPath);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! function_exists('is_file_exists')) {
|
||||||
|
function is_file_exists($path)
|
||||||
|
{
|
||||||
|
return File::exists(public_path('storage/' . $path));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!function_exists('get_role_name')) {
|
if (!function_exists('get_role_name')) {
|
||||||
function get_role_name($role = null) {
|
function get_role_name($role = null)
|
||||||
|
{
|
||||||
|
|
||||||
if($role === null){
|
if ($role === null) {
|
||||||
$role = Auth::user()->role_id;
|
$role = Auth::user()->role_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch($role) {
|
switch ($role) {
|
||||||
case '1':
|
case '1':
|
||||||
return "Administrator";
|
return "Administrator";
|
||||||
case '2':
|
case '2':
|
||||||
@ -222,7 +223,8 @@ function get_role_name($role = null) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('shorten_text')) {
|
if (!function_exists('shorten_text')) {
|
||||||
function shorten_text($text, $maxLength = 100) {
|
function shorten_text($text, $maxLength = 100)
|
||||||
|
{
|
||||||
if (strlen($text) > $maxLength) {
|
if (strlen($text) > $maxLength) {
|
||||||
return substr($text, 0, $maxLength) . '...';
|
return substr($text, 0, $maxLength) . '...';
|
||||||
}
|
}
|
||||||
@ -232,7 +234,8 @@ function shorten_text($text, $maxLength = 100) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! function_exists('is_role')) {
|
if (! function_exists('is_role')) {
|
||||||
function is_role($roles) {
|
function is_role($roles)
|
||||||
|
{
|
||||||
if (Auth::check()) {
|
if (Auth::check()) {
|
||||||
return in_array(Auth::user()->role_id, (array) $roles) || Auth::user()->role_id === '4';
|
return in_array(Auth::user()->role_id, (array) $roles) || Auth::user()->role_id === '4';
|
||||||
}
|
}
|
||||||
@ -267,7 +270,7 @@ function idn_date($tanggal, $format = 'd F Y')
|
|||||||
if (!function_exists('get_user_status')) {
|
if (!function_exists('get_user_status')) {
|
||||||
function get_user_status($status)
|
function get_user_status($status)
|
||||||
{
|
{
|
||||||
switch($status){
|
switch ($status) {
|
||||||
case '0':
|
case '0':
|
||||||
return 'Menunggu';
|
return 'Menunggu';
|
||||||
case '1':
|
case '1':
|
||||||
@ -283,7 +286,7 @@ function get_user_status($status)
|
|||||||
if (!function_exists('get_edit_status')) {
|
if (!function_exists('get_edit_status')) {
|
||||||
function get_edit_status($status)
|
function get_edit_status($status)
|
||||||
{
|
{
|
||||||
switch($status){
|
switch ($status) {
|
||||||
case '0':
|
case '0':
|
||||||
return 'Tidak Ada';
|
return 'Tidak Ada';
|
||||||
case '1':
|
case '1':
|
||||||
@ -299,56 +302,58 @@ function get_edit_status($status)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! function_exists('get_cooperation_notif')) {
|
if (! function_exists('get_cooperation_notif')) {
|
||||||
function get_cooperation_notif() {
|
function get_cooperation_notif()
|
||||||
|
{
|
||||||
$user = User::findOrFail(Auth::id());
|
$user = User::findOrFail(Auth::id());
|
||||||
if($user->role_id === 3){
|
if ($user->role_id === 3) {
|
||||||
$mediaId = $user->company->media->id;
|
$mediaId = $user->company->media->id;
|
||||||
|
|
||||||
$media = Media::with('cooperations')->findOrFail($mediaId);
|
$media = Media::with('cooperations')->findOrFail($mediaId);
|
||||||
return $media->cooperations()
|
return $media->cooperations()
|
||||||
->where('start_date', '<=', Carbon::now()->locale('id')->toDateString())
|
->where('start_date', '<=', Carbon::now()->locale('id')->toDateString())
|
||||||
->where('end_date', '>=', Carbon::now()->locale('id')->toDateString())
|
->where('end_date', '>=', Carbon::now()->locale('id')->toDateString())
|
||||||
->count();
|
->count();
|
||||||
|
} else {
|
||||||
}else{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! function_exists('slugify')) {
|
if (! function_exists('slugify')) {
|
||||||
function slugify($param) {
|
function slugify($param)
|
||||||
|
{
|
||||||
return Str::slug($param);
|
return Str::slug($param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! function_exists('get_unread_announcements')) {
|
if (! function_exists('get_unread_announcements')) {
|
||||||
function get_unread_announcements() {
|
function get_unread_announcements()
|
||||||
|
{
|
||||||
$user = User::findOrFail(Auth::id());
|
$user = User::findOrFail(Auth::id());
|
||||||
if($user->role_id === 3){
|
if ($user->role_id === 3) {
|
||||||
$userId = $user->id;
|
$userId = $user->id;
|
||||||
|
|
||||||
$user = User::with('announcements')->findOrFail($userId);
|
$user = User::with('announcements')->findOrFail($userId);
|
||||||
return $user->announcements()
|
return $user->announcements()
|
||||||
->wherePivot('status', '=', '0')
|
->wherePivot('status', '=', '0')
|
||||||
->count();
|
->count();
|
||||||
|
} else {
|
||||||
}else{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! function_exists('display_image')) {
|
if (! function_exists('display_image')) {
|
||||||
function display_image($name, $dir = 'defaults', $default = 'default.jpg') {
|
function display_image($name, $dir = 'defaults', $default = 'default.jpg')
|
||||||
|
{
|
||||||
$path = "uploads/{$dir}/{$name}";
|
$path = "uploads/{$dir}/{$name}";
|
||||||
$defaultPath = "assets/defaults/{$default}";
|
$defaultPath = "assets/defaults/{$default}";
|
||||||
|
|
||||||
if (Storage::disk('public')->exists($path)) {
|
if (Storage::disk('public')->exists($path)) {
|
||||||
try {
|
try {
|
||||||
if(Storage::disk('public')->get($path)){
|
if (Storage::disk('public')->get($path)) {
|
||||||
return "storage/{$path}";
|
return "storage/{$path}";
|
||||||
}else{
|
} else {
|
||||||
return $defaultPath;
|
return $defaultPath;
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@ -409,9 +414,10 @@ function get_user_agent($userAgentParam): array
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! function_exists('change_status')) {
|
if (! function_exists('change_status')) {
|
||||||
function change_status($status, $category) {
|
function change_status($status, $category)
|
||||||
if(in_array($category, ['company_edit', 'media_edit'])){
|
{
|
||||||
switch($status){
|
if (in_array($category, ['company_edit', 'media_edit'])) {
|
||||||
|
switch ($status) {
|
||||||
case '0':
|
case '0':
|
||||||
return '1';
|
return '1';
|
||||||
case '1':
|
case '1':
|
||||||
@ -426,19 +432,21 @@ function change_status($status, $category) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! function_exists('titlefy')) {
|
if (! function_exists('titlefy')) {
|
||||||
function titlefy($text) {
|
function titlefy($text)
|
||||||
if(filled($text)){
|
{
|
||||||
|
if (filled($text)) {
|
||||||
return Str::title($text);
|
return Str::title($text);
|
||||||
}else{
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('get_activity_log_name')) {
|
if (!function_exists('get_activity_log_name')) {
|
||||||
function get_activity_log_name($name) {
|
function get_activity_log_name($name)
|
||||||
|
{
|
||||||
|
|
||||||
switch($name) {
|
switch ($name) {
|
||||||
case 'airing_proof_theme':
|
case 'airing_proof_theme':
|
||||||
return [
|
return [
|
||||||
'name' => 'Tema Bukti Tayang',
|
'name' => 'Tema Bukti Tayang',
|
||||||
|
|||||||
24
config/view.php
Normal file
24
config/view.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| View Storage Paths
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
'paths' => [
|
||||||
|
resource_path('views'),
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Compiled View Path
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
'compiled' => env(
|
||||||
|
'VIEW_COMPILED_PATH',
|
||||||
|
realpath(storage_path('framework/views'))
|
||||||
|
),
|
||||||
|
|
||||||
|
];
|
||||||
@ -1,22 +0,0 @@
|
|||||||
services:
|
|
||||||
app:
|
|
||||||
container_name: purwakarta-diskominfo-simedkom
|
|
||||||
image: ${DOCKER_REGISTRY}/pratama/${IMAGE_NAME}:${IMAGE_TAG}
|
|
||||||
# build: .
|
|
||||||
ports:
|
|
||||||
- "8992:80"
|
|
||||||
env_file:
|
|
||||||
- slack.env
|
|
||||||
networks:
|
|
||||||
- gitlab-repo
|
|
||||||
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "curl", "--fail", "http://localhost/"]
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 3
|
|
||||||
start_period: 5s
|
|
||||||
|
|
||||||
networks:
|
|
||||||
gitlab-repo:
|
|
||||||
external: true
|
|
||||||
@ -1,71 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
cd /app
|
|
||||||
|
|
||||||
# Install dependency jika belum ada vendor/
|
|
||||||
if [ ! -d vendor ]; then
|
|
||||||
echo "Installing dependencies..."
|
|
||||||
composer install --no-interaction --prefer-dist --optimize-autoloader
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Jika file .env tidak ada, copy dari slack.env
|
|
||||||
if [ ! -f .env ]; then
|
|
||||||
echo "Copying slack.env to .env"
|
|
||||||
cp slack.env .env
|
|
||||||
fi
|
|
||||||
|
|
||||||
php artisan cache:table
|
|
||||||
php artisan migrate
|
|
||||||
|
|
||||||
# Generate app key jika belum ada
|
|
||||||
if ! grep -q "APP_KEY=" .env || [ -z "$(php artisan key:generate --show 2>/dev/null)" ]; then
|
|
||||||
echo "Generating app key..."
|
|
||||||
php artisan key:generate
|
|
||||||
fi
|
|
||||||
# echo "Generating app key..."
|
|
||||||
# php artisan key:generate
|
|
||||||
|
|
||||||
# # Cek apakah database sudah terhubung
|
|
||||||
# if ! php artisan migrate:status > /dev/null 2>&1; then
|
|
||||||
# echo "Database connection failed. Please check your .env file."
|
|
||||||
# exit 1
|
|
||||||
# fi
|
|
||||||
|
|
||||||
# # Cek apakah optimize sudah bersih
|
|
||||||
# if ! php artisan optimize:clear > /dev/null 2>&1; then
|
|
||||||
# echo "Clearing optimize..."
|
|
||||||
# php artisan optimize:clear || {
|
|
||||||
# echo "Optimize clear failed. Please check your Laravel setup."
|
|
||||||
# exit 1
|
|
||||||
# }
|
|
||||||
# fi
|
|
||||||
|
|
||||||
# Cek apakah config sudah bersih
|
|
||||||
# if ! php artisan config:clear > /dev/null 2>&1; then
|
|
||||||
# echo "Clearing config cache..."
|
|
||||||
# php artisan config:clear || {
|
|
||||||
# echo "Config clear failed. Please check your Laravel setup."
|
|
||||||
# exit 1
|
|
||||||
# }
|
|
||||||
# fi
|
|
||||||
|
|
||||||
# Cek apakah route sudah bersih
|
|
||||||
# if ! php artisan route:clear > /dev/null 2>&1; then
|
|
||||||
# echo "Clearing route cache..."
|
|
||||||
# php artisan route:clear || {
|
|
||||||
# echo "Route clear failed. Please check your Laravel setup."
|
|
||||||
# exit 1
|
|
||||||
# }
|
|
||||||
# fi
|
|
||||||
|
|
||||||
# Jalankan migrasi
|
|
||||||
echo "Running migrations..."
|
|
||||||
#php artisan migrate --force || true
|
|
||||||
php artisan migrate:fresh --seed --force || true
|
|
||||||
|
|
||||||
echo "Seeding database..."
|
|
||||||
php artisan db:seed --force || true
|
|
||||||
|
|
||||||
# Start server
|
|
||||||
echo "Starting Laravel server..."
|
|
||||||
exec frankenphp php-server --root public
|
|
||||||
69
slack.env
69
slack.env
@ -1,69 +0,0 @@
|
|||||||
APP_NAME=Laravel
|
|
||||||
APP_ENV=local
|
|
||||||
APP_KEY=base64:PfCPtSPUU+C+slwgUm0TeUzy4sOcDslf0QEYtMt56bs=
|
|
||||||
APP_DEBUG=true
|
|
||||||
APP_URL=http://localhost
|
|
||||||
|
|
||||||
APP_LOCALE=en
|
|
||||||
APP_FALLBACK_LOCALE=en
|
|
||||||
APP_FAKER_LOCALE=en_US
|
|
||||||
|
|
||||||
APP_MAINTENANCE_DRIVER=file
|
|
||||||
# APP_MAINTENANCE_STORE=database
|
|
||||||
|
|
||||||
PHP_CLI_SERVER_WORKERS=4
|
|
||||||
|
|
||||||
BCRYPT_ROUNDS=12
|
|
||||||
|
|
||||||
LOG_CHANNEL=stack
|
|
||||||
LOG_STACK=single
|
|
||||||
LOG_DEPRECATIONS_CHANNEL=null
|
|
||||||
LOG_LEVEL=debug
|
|
||||||
|
|
||||||
DB_CONNECTION=mysql
|
|
||||||
DB_HOST=10.10.30.253
|
|
||||||
DB_PORT=3306
|
|
||||||
DB_DATABASE=simedkom
|
|
||||||
DB_USERNAME=simedkom
|
|
||||||
DB_PASSWORD=l2d7YsJm1EdWT4GvDk6B1URpLAm0Bu9h
|
|
||||||
|
|
||||||
SESSION_DRIVER=database
|
|
||||||
SESSION_LIFETIME=120
|
|
||||||
SESSION_ENCRYPT=false
|
|
||||||
SESSION_PATH=/
|
|
||||||
SESSION_DOMAIN=null
|
|
||||||
|
|
||||||
BROADCAST_CONNECTION=log
|
|
||||||
FILESYSTEM_DISK=local
|
|
||||||
QUEUE_CONNECTION=database
|
|
||||||
|
|
||||||
CACHE_STORE=database
|
|
||||||
# CACHE_PREFIX=
|
|
||||||
|
|
||||||
MEMCACHED_HOST=127.0.0.1
|
|
||||||
|
|
||||||
REDIS_CLIENT=phpredis
|
|
||||||
REDIS_HOST=127.0.0.1
|
|
||||||
REDIS_PASSWORD=null
|
|
||||||
REDIS_PORT=6379
|
|
||||||
|
|
||||||
MAIL_MAILER=log
|
|
||||||
MAIL_SCHEME=null
|
|
||||||
MAIL_HOST=127.0.0.1
|
|
||||||
MAIL_PORT=2525
|
|
||||||
MAIL_USERNAME=null
|
|
||||||
MAIL_PASSWORD=null
|
|
||||||
MAIL_FROM_ADDRESS="hello@example.com"
|
|
||||||
MAIL_FROM_NAME="${APP_NAME}"
|
|
||||||
|
|
||||||
S3_ACCESS_KEY=GCLSD4PCBWV9JJ09X6KB
|
|
||||||
S3_SECRET_KEY=+ABULfHK6uJ2nUQnymfQtxyssrZmCpGp6uSz7o3b
|
|
||||||
S3_REGION=pratama-live
|
|
||||||
S3_BUCKET_NAME=purwakarta-diskominfo-simedkom
|
|
||||||
S3_ENDPOINT_URL=http://s3.pratama.live
|
|
||||||
AWS_USE_PATH_STYLE_ENDPOINT=true
|
|
||||||
|
|
||||||
VITE_APP_NAME="${APP_NAME}"
|
|
||||||
|
|
||||||
RECAPTCHA_SITE_KEY=6Lcy9uEoAAAAALWxQu-0kuS_YAjGpDVpdk1FxPL8
|
|
||||||
RECAPTCHA_SECRET_KEY=6Lcy9uEoAAAAAIc54Fi8fPEbbJ9kYi9odkmUfdNy
|
|
||||||
Loading…
Reference in New Issue
Block a user