-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-1643030 Convert package scripts to post-deploy hooks (#1538)
PDFv2 doesn't support package scripts, so we need to convert them to post-deploy hooks. Since package scripts use a different Jinja template syntax (`{{ }}` instead of `<% %>`), we need to convert the actual files as well.
- Loading branch information
1 parent
4bfecfe
commit ee0e00d
Showing
9 changed files
with
128 additions
and
25 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
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
4 changes: 4 additions & 0 deletions
4
tests/test_data/projects/migration_package_scripts/app/README.md
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,4 @@ | ||
# README | ||
|
||
This directory contains an extremely simple application that is used for | ||
integration testing SnowCLI. |
18 changes: 18 additions & 0 deletions
18
tests/test_data/projects/migration_package_scripts/app/manifest.yml
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,18 @@ | ||
# This is a manifest.yml file, a required component of creating a native application. | ||
# This file defines properties required by the application package, including the location of the setup script and version definitions. | ||
# Refer to https://docs.snowflake.com/en/developer-guide/native-apps/creating-manifest for a detailed understanding of this file. | ||
|
||
manifest_version: 1 | ||
|
||
version: | ||
name: dev | ||
label: "Dev Version" | ||
comment: "Default version used for development. Override for actual deployment." | ||
|
||
artifacts: | ||
setup_script: setup.sql | ||
readme: README.md | ||
|
||
configuration: | ||
log_level: INFO | ||
trace_level: ALWAYS |
19 changes: 19 additions & 0 deletions
19
tests/test_data/projects/migration_package_scripts/app/setup.sql
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,19 @@ | ||
create application role if not exists app_public; | ||
create or alter versioned schema core; | ||
|
||
create or replace procedure core.echo(inp varchar) | ||
returns varchar | ||
language sql | ||
immutable | ||
as | ||
$$ | ||
begin | ||
return inp; | ||
end; | ||
$$; | ||
|
||
grant usage on procedure core.echo(varchar) to application role app_public; | ||
|
||
create or replace view core.shared_view as select * from my_shared_content.shared_table; | ||
|
||
grant select on view core.shared_view to application role app_public; |
2 changes: 2 additions & 0 deletions
2
tests/test_data/projects/migration_package_scripts/package_scripts/001.sql
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,2 @@ | ||
-- Just a demo package script, won't actually be executed in tests | ||
select * from {{ package_name }}.my_schema.my_table |
2 changes: 2 additions & 0 deletions
2
tests/test_data/projects/migration_package_scripts/package_scripts/002.sql
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,2 @@ | ||
-- Just a demo package script, won't actually be executed in tests | ||
select * from {{ package_name }}.my_schema.my_table |
11 changes: 11 additions & 0 deletions
11
tests/test_data/projects/migration_package_scripts/snowflake.yml
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,11 @@ | ||
definition_version: 1 | ||
native_app: | ||
name: myapp | ||
source_stage: app_src.stage | ||
artifacts: | ||
- src: app/* | ||
dest: ./ | ||
package: | ||
scripts: | ||
- package_scripts/001.sql | ||
- package_scripts/002.sql |
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