-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ZEA-4175: Handle the containerized mode of Node.js output directory (#…
…376) #### Description (required) - **fix(planner/nodejs): Make build script determination reliable** - **refactor(planner/gleam): Optimize serverless generation** - **feat(planner/nodejs): Support containerized outputDir generation** - **feat(planner/nodejs): Support containerized static** - **feat(zbpack): Support new containerized static convention** - **feat(planner/dart): Support containerized static** - **fix(planner/nodejs): Do not fill start command if there is static output directory** - **test(transformer): Update for latest serverless + outputDir convention** - **test(e2e): Add vite vanilla test** - **chore: Update dependencies** - **ci: Use go-version-file for release** Node.js and Flutter has been manually tested. #### Related issues & labels (optional) - Closes ZEA-4175 - Suggested label: enhancement, bug
- Loading branch information
Showing
30 changed files
with
261 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ permissions: | |
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -19,7 +19,7 @@ jobs: | |
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.22 | ||
go-version-file: "go.mod" | ||
- name: Run GoReleaser | ||
uses: goreleaser/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package dart_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/zeabur/zbpack/internal/dart" | ||
) | ||
|
||
func TestGenerateDockerfileStatic(t *testing.T) { | ||
t.Parallel() | ||
|
||
t.Run("flutter, serverless", func(t *testing.T) { | ||
t.Parallel() | ||
|
||
dockerfile, err := dart.GenerateDockerfile(map[string]string{ | ||
"framework": "flutter", | ||
"serverless": "true", | ||
}) | ||
|
||
assert.NoError(t, err) | ||
assert.Contains(t, dockerfile, "FROM scratch") | ||
assert.NotContains(t, dockerfile, "FROM zeabur/caddy-static") | ||
}) | ||
|
||
t.Run("flutter, non-serverless", func(t *testing.T) { | ||
t.Parallel() | ||
|
||
dockerfile, err := dart.GenerateDockerfile(map[string]string{ | ||
"framework": "flutter", | ||
"serverless": "false", | ||
}) | ||
|
||
assert.NoError(t, err) | ||
assert.Contains(t, dockerfile, "FROM scratch") | ||
assert.Contains(t, dockerfile, "FROM zeabur/caddy-static") | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package gleam_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/zeabur/zbpack/internal/gleam" | ||
) | ||
|
||
func TestGenerateDockerfile(t *testing.T) { | ||
t.Parallel() | ||
|
||
t.Run("serverless", func(t *testing.T) { | ||
t.Parallel() | ||
|
||
dockerfile, err := gleam.GenerateDockerfile(map[string]string{ | ||
"serverless": "true", | ||
}) | ||
|
||
assert.NoError(t, err) | ||
assert.Contains(t, dockerfile, "\nFROM scratch AS output") | ||
}) | ||
|
||
t.Run("non-serverless", func(t *testing.T) { | ||
t.Parallel() | ||
|
||
dockerfile, err := gleam.GenerateDockerfile(map[string]string{ | ||
"serverless": "false", | ||
}) | ||
|
||
assert.NoError(t, err) | ||
assert.Contains(t, dockerfile, "\nWORKDIR /app") | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.