From 538c258117f01ae6485ee9643548b1407f2e4f6b Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 15 Sep 2023 06:01:17 +0000 Subject: [PATCH 1/5] chore: update ci --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4d7fbb7b7a..4d1bfda26e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,7 +16,7 @@ jobs: with: fetch-depth: 2 submodules: recursive - ref: feat-db-pools-master + ref: cl-1.4.x - name: Login to Docker Hub uses: docker/login-action@v2 From 94117ed471eb060b4a8090c152289a685173e98f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 18 Sep 2023 12:33:05 +0200 Subject: [PATCH 2/5] Fix build race condition --- src/Executor/Executor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index 36f6ad0dc5..5fb4cffbd2 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -70,7 +70,7 @@ class Executor array $variables = [], string $command = null, ) { - $runtimeId = "$projectId-$deploymentId"; + $runtimeId = "$projectId-$deploymentId-build"; $route = "/runtimes"; $params = [ 'runtimeId' => $runtimeId, From dc1d9fa6357883b6565c462effa11bb30c343d52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 18 Sep 2023 12:39:19 +0200 Subject: [PATCH 3/5] Fix wrong device type --- app/workers/builds.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/workers/builds.php b/app/workers/builds.php index 89aa22edb7..52d8d1a4fa 100644 --- a/app/workers/builds.php +++ b/app/workers/builds.php @@ -112,6 +112,8 @@ class BuildsV1 extends Worker $isNewBuild = empty($buildId); + $deviceFunctions = $this->getFunctionsDevice($project->getId()); + if ($isNewBuild) { $buildId = ID::unique(); $build = $dbForProject->createDocument('builds', new Document([ @@ -124,7 +126,7 @@ class BuildsV1 extends Worker 'path' => '', 'runtime' => $function->getAttribute('runtime'), 'source' => $deployment->getAttribute('path', ''), - 'sourceType' => strtolower(App::getEnv('_APP_STORAGE_DEVICE', Storage::DEVICE_LOCAL)), + 'sourceType' => strtolower($deviceFunctions->getType()), 'logs' => '', 'endTime' => null, 'duration' => 0, @@ -254,8 +256,6 @@ class BuildsV1 extends Worker Console::execute('tar --exclude code.tar.gz -czf ' . $tmpPathFile . ' -C /tmp/builds/' . \escapeshellcmd($buildId) . '/code' . (empty($rootDirectory) ? '' : '/' . $rootDirectory) . ' .', '', $stdout, $stderr); - $deviceFunctions = $this->getFunctionsDevice($project->getId()); - $localDevice = new Local(); $buffer = $localDevice->read($tmpPathFile); $mimeType = $localDevice->getFileMimeType($tmpPathFile); From d3f83c24664ad29b8e802264812183cf79638385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 18 Sep 2023 12:41:25 +0200 Subject: [PATCH 4/5] Linter fix --- app/workers/builds.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/workers/builds.php b/app/workers/builds.php index 52d8d1a4fa..fb71dadcf5 100644 --- a/app/workers/builds.php +++ b/app/workers/builds.php @@ -113,7 +113,7 @@ class BuildsV1 extends Worker $isNewBuild = empty($buildId); $deviceFunctions = $this->getFunctionsDevice($project->getId()); - + if ($isNewBuild) { $buildId = ID::unique(); $build = $dbForProject->createDocument('builds', new Document([ From a19967910160619718ada8321a3e0787364b212d Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 18 Sep 2023 11:50:23 -0400 Subject: [PATCH 5/5] chore: update ci scripts --- .github/workflows/publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4d1bfda26e..a87f1e574f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,9 +1,9 @@ -name: "Build and Publish" +name: "Build and Publish Appwrite Images for Cloud" on: push: tags: - - appwrite-* + - cl-* jobs: build-publish: @@ -16,7 +16,7 @@ jobs: with: fetch-depth: 2 submodules: recursive - ref: cl-1.4.x + ref: master - name: Login to Docker Hub uses: docker/login-action@v2