Skip to content

Commit

Permalink
Added optional backend and frontend image names to deployment script
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardogsilva committed Nov 25, 2024
1 parent fc2f1dc commit 630b66a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Continuous Integration

on:
push:
push: # will run both when pushing a branch and when pushing a tag

pull_request:

Expand Down
23 changes: 23 additions & 0 deletions deployments/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,12 +518,35 @@ def perform_deployment(
"in dry-run mode, just showing what steps would be performed"
),
)
parser.add_argument(
"-b",
"--backend-image",
help=(
"Full name of the docker image to be used for the backend. "
"Example: "
"'ghcr.io/geobeyond/arpav-ppcv-backend/arpav-ppcv-backend:v1.0.0'. "
"Defaults to whatever is specified in the configuration file."
),
)
parser.add_argument(
"-f",
"--frontend-image",
help=(
"Full name of the docker image to be used for the frontend. "
"Example: 'ghcr.io/geobeyond/arpav-ppcv/arpav-ppcv:v1.0.0'. "
"Defaults to whatever is specified in the configuration file."
),
)
args = parser.parse_args()
logging.basicConfig(level=logging.DEBUG if args.verbose else logging.WARNING)
config_file = args.config_file.resolve()
logger.debug(f"{config_file=}")
if config_file.exists():
deployment_config = get_configuration(config_file)
if (backend_image_name := args.backend_image) is not None:
deployment_config.backend_image = backend_image_name
if (frontend_image_name := args.frontend_image) is not None:
deployment_config.frontend_image = frontend_image_name
deployment_config.ensure_paths_exist()
logger.debug("Configuration:")
for k, v in dataclasses.asdict(deployment_config).items():
Expand Down

0 comments on commit 630b66a

Please sign in to comment.