This commit is contained in:
Andras Bacsai 2023-05-25 13:19:39 +02:00
parent 2834d7f342
commit 89ba10ab4e
27 changed files with 34 additions and 36 deletions

View File

@ -60,7 +60,7 @@ public function handle()
]; ];
return PendingRequest::withHeaders($headers)->post('https://api.bunny.net/purge', [ return PendingRequest::withHeaders($headers)->post('https://api.bunny.net/purge', [
"urls" => [$url], "urls" => [$url],
]); ])->throw();
}); });
try { try {
Http::pool(fn (Pool $pool) => [ Http::pool(fn (Pool $pool) => [
@ -72,15 +72,13 @@ public function handle()
$pool->storage(file: "$parent_dir/scripts/$docker_install_script")->put("/$bunny_cdn_storage_name/$bunny_cdn_path/$docker_install_script"), $pool->storage(file: "$parent_dir/scripts/$docker_install_script")->put("/$bunny_cdn_storage_name/$bunny_cdn_path/$docker_install_script"),
$pool->storage(file: "$parent_dir/$versions")->put("/$bunny_cdn_storage_name/$versions"), $pool->storage(file: "$parent_dir/$versions")->put("/$bunny_cdn_storage_name/$versions"),
]); ]);
Http::pool(fn (Pool $pool) => [ Http::withHeaders([
$pool->purge(url: "$bunny_cdn/$bunny_cdn_path/$compose_file"), 'AccessKey' => env('BUNNY_API_KEY'),
$pool->purge(url: "$bunny_cdn/$bunny_cdn_path/$compose_file_prod"), 'Accept' => 'application/json',
$pool->purge(url: "$bunny_cdn/$bunny_cdn_path/$production_env"), ])->get('https://api.bunny.net/purge', [
$pool->purge(url: "$bunny_cdn/$bunny_cdn_path/$upgrade_script"), "url" => "$bunny_cdn/$bunny_cdn_path/*",
$pool->purge(url: "$bunny_cdn/$bunny_cdn_path/$install_script"), "async" => false
$pool->purge(url: "$bunny_cdn/$bunny_cdn_path/$docker_install_script"), ])->throw();
$pool->purge(url: "$bunny_cdn/$versions"),
]);
echo "All files uploaded & purged...\n"; echo "All files uploaded & purged...\n";
} catch (\Exception $e) { } catch (\Exception $e) {
echo $e->getMessage(); echo $e->getMessage();

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('users', function (Blueprint $table) { Schema::create('users', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('uuid')->unique(); $table->string('uuid')->unique();
$table->boolean('is_root_user')->default(false); $table->boolean('is_root_user')->default(false);
$table->string('name')->default('Your Name Here'); $table->string('name')->default('Your Name Here');

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('personal_access_tokens', function (Blueprint $table) { Schema::create('personal_access_tokens', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->morphs('tokenable'); $table->morphs('tokenable');
$table->string('name'); $table->string('name');
$table->string('token', 64)->unique(); $table->string('token', 64)->unique();

View File

@ -9,7 +9,7 @@ class CreateActivityLogTable extends Migration
public function up() public function up()
{ {
Schema::connection(config('activitylog.database_connection'))->create(config('activitylog.table_name'), function (Blueprint $table) { Schema::connection(config('activitylog.database_connection'))->create(config('activitylog.table_name'), function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('log_name')->nullable(); $table->string('log_name')->nullable();
$table->text('description'); $table->text('description');
$table->nullableMorphs('subject', 'subject'); $table->nullableMorphs('subject', 'subject');

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('teams', function (Blueprint $table) { Schema::create('teams', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('uuid')->unique(); $table->string('uuid')->unique();
$table->string('name'); $table->string('name');
$table->boolean('personal_team')->default(false); $table->boolean('personal_team')->default(false);

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('team_user', function (Blueprint $table) { Schema::create('team_user', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->foreignId('team_id'); $table->foreignId('team_id');
$table->foreignId('user_id'); $table->foreignId('user_id');
$table->string('role')->nullable(); $table->string('role')->nullable();

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('instance_settings', function (Blueprint $table) { Schema::create('instance_settings', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('fqdn')->nullable(); $table->string('fqdn')->nullable();
$table->string('wildcard_domain')->nullable(); $table->string('wildcard_domain')->nullable();
$table->string('redirect_url')->nullable(); $table->string('redirect_url')->nullable();

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('servers', function (Blueprint $table) { Schema::create('servers', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('uuid')->unique(); $table->string('uuid')->unique();
$table->string('name'); $table->string('name');
$table->string('description')->nullable(); $table->string('description')->nullable();

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('server_settings', function (Blueprint $table) { Schema::create('server_settings', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('uuid')->unique(); $table->string('uuid')->unique();
$table->boolean('is_part_of_swarm')->default(false); $table->boolean('is_part_of_swarm')->default(false);

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('private_keys', function (Blueprint $table) { Schema::create('private_keys', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('uuid')->unique(); $table->string('uuid')->unique();
$table->string('name'); $table->string('name');
$table->string('description')->nullable(); $table->string('description')->nullable();

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('projects', function (Blueprint $table) { Schema::create('projects', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('uuid')->unique(); $table->string('uuid')->unique();
$table->string('name'); $table->string('name');
$table->string('description')->nullable(); $table->string('description')->nullable();

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('project_settings', function (Blueprint $table) { Schema::create('project_settings', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('uuid')->unique(); $table->string('uuid')->unique();
$table->string('wildcard_domain')->nullable(); $table->string('wildcard_domain')->nullable();

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('environments', function (Blueprint $table) { Schema::create('environments', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('name'); $table->string('name');
$table->foreignId('project_id'); $table->foreignId('project_id');
$table->timestamps(); $table->timestamps();

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('applications', function (Blueprint $table) { Schema::create('applications', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->integer('repository_project_id')->nullable(); $table->integer('repository_project_id')->nullable();
$table->string('uuid')->unique(); $table->string('uuid')->unique();
$table->string('name'); $table->string('name');

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('application_settings', function (Blueprint $table) { Schema::create('application_settings', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->boolean('is_static')->default(false); $table->boolean('is_static')->default(false);
$table->boolean('is_git_submodules_allowed')->default(true); $table->boolean('is_git_submodules_allowed')->default(true);
$table->boolean('is_git_lfs_allowed')->default(true); $table->boolean('is_git_lfs_allowed')->default(true);

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('databases', function (Blueprint $table) { Schema::create('databases', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('uuid')->unique(); $table->string('uuid')->unique();
$table->string('name'); $table->string('name');

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('services', function (Blueprint $table) { Schema::create('services', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('uuid')->unique(); $table->string('uuid')->unique();
$table->string('name'); $table->string('name');

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('standalone_dockers', function (Blueprint $table) { Schema::create('standalone_dockers', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('name'); $table->string('name');
$table->string('uuid')->unique(); $table->string('uuid')->unique();
$table->string('network'); $table->string('network');

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('swarm_dockers', function (Blueprint $table) { Schema::create('swarm_dockers', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('name'); $table->string('name');
$table->string('uuid')->unique(); $table->string('uuid')->unique();

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('kubernetes', function (Blueprint $table) { Schema::create('kubernetes', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('uuid')->unique(); $table->string('uuid')->unique();
$table->timestamps(); $table->timestamps();

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('gits', function (Blueprint $table) { Schema::create('gits', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->enum('type', ['github', 'gitlab', 'bitbucket', 'custom']); $table->enum('type', ['github', 'gitlab', 'bitbucket', 'custom']);
$table->string('api_url'); $table->string('api_url');

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('github_apps', function (Blueprint $table) { Schema::create('github_apps', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('uuid')->unique(); $table->string('uuid')->unique();
$table->string('name'); $table->string('name');

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('gitlab_apps', function (Blueprint $table) { Schema::create('gitlab_apps', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('uuid')->unique(); $table->string('uuid')->unique();
$table->string('name'); $table->string('name');

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('local_persistent_volumes', function (Blueprint $table) { Schema::create('local_persistent_volumes', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('uuid')->unique(); $table->string('uuid')->unique();
$table->string('name'); $table->string('name');
$table->string('mount_path'); $table->string('mount_path');

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('environment_variables', function (Blueprint $table) { Schema::create('environment_variables', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('key'); $table->string('key');
$table->string('value')->nullable(); $table->string('value')->nullable();

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('failed_jobs', function (Blueprint $table) { Schema::create('failed_jobs', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('uuid')->unique(); $table->string('uuid')->unique();
$table->text('connection'); $table->text('connection');
$table->text('queue'); $table->text('queue');

View File

@ -12,7 +12,7 @@
public function up(): void public function up(): void
{ {
Schema::create('application_deployment_queues', function (Blueprint $table) { Schema::create('application_deployment_queues', function (Blueprint $table) {
$table->bigIncrements('id'); $table->id()->primary();
$table->string('application_id'); $table->string('application_id');
$table->integer('pull_request_id')->default(0); $table->integer('pull_request_id')->default(0);
$table->schemalessAttributes('metadata'); $table->schemalessAttributes('metadata');