-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add python monorepo support (#162)
- Loading branch information
Showing
18 changed files
with
316 additions
and
27 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
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,15 @@ | ||
parameters: | ||
working_directory: | ||
description: Directory containing pyproject.toml | ||
type: string | ||
default: './' | ||
run_in_background: | ||
description: run the command in background | ||
type: boolean | ||
default: false | ||
steps: | ||
- run: | ||
working_directory: << parameters.working_directory >> | ||
background: << parameters.run_in_background >> | ||
name: authenticate poetry | ||
command: <<include(scripts/python/authenticate-poetry.sh)>> |
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,54 @@ | ||
parameters: | ||
install_args: | ||
description: Additional poetry install command options | ||
type: string | ||
default: "" | ||
working_directory: | ||
description: Directory containing package.json | ||
type: string | ||
default: './' | ||
step_name: | ||
description: Name of the step | ||
type: string | ||
default: Install node modules | ||
cache_prefix: | ||
description: Cache prefix | ||
type: string | ||
default: '' | ||
run_in_background: | ||
description: Run poetry install in background mode | ||
type: boolean | ||
default: false | ||
wait: | ||
description: wait until all the commands are finished | ||
type: boolean | ||
default: false | ||
run_in_container: | ||
description: Run build in a container | ||
type: boolean | ||
default: false | ||
request_remote_docker: | ||
description: Request remote Docker | ||
type: boolean | ||
default: false | ||
container_folder_to_copy: | ||
description: Container folder to copy after the execution | ||
type: string | ||
default: "" | ||
steps: | ||
- authenticate_poetry | ||
- vf_python_restore_cache: | ||
working_directory: << parameters.working_directory >> | ||
cache_prefix: << parameters.cache_prefix >> | ||
- yarn_command: | ||
working_directory: << parameters.working_directory >> | ||
run_in_background: << parameters.run_in_background >> | ||
request_remote_docker: << parameters.request_remote_docker >> | ||
container_folder_to_copy: << parameters.container_folder_to_copy >> | ||
run_in_container: << parameters.run_in_container >> | ||
step_name: << parameters.step_name >> | ||
wait: << parameters.wait >> | ||
yarn_command: poetry install --directory << parameters.working_directory >>/.poetry << parameters.install_args >> | ||
- vf_python_save_cache: # special step to save the dependency cache | ||
working_directory: << parameters.working_directory >> | ||
cache_prefix: << parameters.cache_prefix >> |
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,43 @@ | ||
parameters: | ||
package: | ||
description: Package name | ||
type: string | ||
default: "" | ||
package_folder: | ||
description: Package folder | ||
type: string | ||
default: "packages" | ||
steps: | ||
# Persist to workspace | ||
- when: | ||
condition: | ||
equal: | ||
- all | ||
- "<< parameters.package >>" | ||
steps: | ||
- persist_to_workspace: | ||
root: "." | ||
paths: | ||
- ./*/*/dist | ||
- when: | ||
condition: | ||
and: | ||
- "<< parameters.package >>" | ||
- not: | ||
equal: | ||
- all | ||
- "<< parameters.package >>" | ||
steps: | ||
- persist_to_workspace: | ||
root: "." | ||
paths: | ||
- << parameters.package_folder >>/<< parameters.package >>/dist | ||
- << parameters.package_folder >>/<< parameters.package >>/poetry.lock | ||
|
||
- unless: | ||
condition: "<< parameters.package >>" | ||
steps: | ||
- persist_to_workspace: | ||
root: "." | ||
paths: | ||
- dist |
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,13 @@ | ||
parameters: | ||
working_directory: | ||
description: Cache directory for poetry.lock file | ||
type: string | ||
default: './' | ||
cache_prefix: | ||
description: Cache prefix | ||
type: string | ||
default: '' | ||
steps: | ||
- restore_cache: | ||
keys: | ||
- python-package-cache-<< parameters.cache_prefix >>-{{ .Environment.CACHE_VERSION }}-{{ checksum "<< parameters.working_directory >>/poetry.lock" }} |
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,14 @@ | ||
parameters: | ||
working_directory: | ||
description: Directory containing package.json | ||
type: string | ||
default: './' | ||
cache_prefix: | ||
description: Cache prefix | ||
type: string | ||
default: '' | ||
steps: | ||
- save_cache: # special step to save the dependency cache | ||
key: python-package-cache-<< parameters.cache_prefix >>-{{ .Environment.CACHE_VERSION }}-{{ checksum "<< parameters.working_directory >>/poetry.lock" }} | ||
paths: | ||
- << parameters.working_directory >>/.venv |
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,43 @@ | ||
parameters: | ||
package: | ||
description: Package name | ||
type: string | ||
default: "" | ||
package_folder: | ||
description: Package folder | ||
type: string | ||
default: "packages" | ||
steps: | ||
# Persist to workspace | ||
- when: | ||
condition: | ||
equal: | ||
- all | ||
- "<< parameters.package >>" | ||
steps: | ||
- persist_to_workspace: | ||
root: "." | ||
paths: | ||
- ./*/*/build | ||
- when: | ||
condition: | ||
and: | ||
- "<< parameters.package >>" | ||
- not: | ||
equal: | ||
- all | ||
- "<< parameters.package >>" | ||
steps: | ||
- persist_to_workspace: | ||
root: "." | ||
paths: | ||
- << parameters.package_folder >>/<< parameters.package >>/build | ||
- << parameters.package_folder >>/<< parameters.package >>/yarn.lock | ||
|
||
- unless: | ||
condition: "<< parameters.package >>" | ||
steps: | ||
- persist_to_workspace: | ||
root: "." | ||
paths: | ||
- build |
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,12 @@ | ||
parameters: | ||
default_resource_class: | ||
description: Default resource class for the executor | ||
type: string | ||
default: medium+ | ||
docker: | ||
- image: 168387678261.dkr.ecr.us-east-1.amazonaws.com/ci-image-python:v1 | ||
aws_auth: | ||
aws_access_key_id: $AWS_ACCESS_KEY_ID | ||
aws_secret_access_key: $AWS_SECRET_ACCESS_KEY | ||
working_directory: ~/voiceflow | ||
resource_class: << parameters.default_resource_class >> |
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.