Skip to content

Commit

Permalink
ci: fix easy-install args in test
Browse files Browse the repository at this point in the history
  • Loading branch information
revant committed Oct 27, 2024
1 parent 18426db commit 97ce6f7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/easy-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:

- name: Perform production easy install
run: |
python3 ${GITHUB_WORKSPACE}/easy-install.py build --image erpnext:version-15
python3 ${GITHUB_WORKSPACE}/easy-install.py -p -n actions_test --email test@frappe.io --image erpnext:version-15
python3 ${GITHUB_WORKSPACE}/easy-install.py build
python3 ${GITHUB_WORKSPACE}/easy-install.py -p -n actions_test --email test@frappe.io --image custom-apps --version latest
docker compose -p actions_test exec backend bench version --format json
docker compose -p actions_test exec backend bench --site site1.localhost list-apps --format json
result=$(curl -H "Host: site1.localhost" -sk https://127.0.0.1/api/method/ping | jq -r ."message")
Expand Down
30 changes: 19 additions & 11 deletions easy-install.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,12 @@ def add_build_parser(argparser: argparse.ArgumentParser):
default="frappe_docker/development/apps-example.json",
)
build.add_argument(
"-i",
"--image",
help="Full Image Name, default: custom-apps:latest",
default="custom-apps:latest",
"-t",
"--tag",
dest="tags",
help="Full Image Name(s), default: custom-apps:latest",
action="append",
default=["custom-apps:latest"],
)
build.add_argument(
"-c",
Expand All @@ -375,7 +377,7 @@ def build_image(
frappe_branch: str,
containerfile_path: str,
apps_json_path: str,
image_name: str,
tags: list[str],
python_version: str,
node_version: str,
):
Expand All @@ -397,7 +399,12 @@ def build_image(
which("docker"),
"build",
"--progress=plain",
f"--tag={image_name}",
]

for tag in tags:
command.append(f"--tag={tag}")

command += [
f"--file={containerfile_path}",
f"--build-arg=FRAPPE_PATH={frappe_path}",
f"--build-arg=FRAPPE_BRANCH={frappe_branch}",
Expand All @@ -419,10 +426,11 @@ def build_image(

if push:
try:
subprocess.run(
[which("docker"), "push", image_name],
check=True,
)
for tag in tags:
subprocess.run(
[which("docker"), "push", tag],
check=True,
)
except Exception as e:
logging.error("Image push failed", exc_info=True)
cprint("\nImage push failed\n\n", "[ERROR]: ", e, level=1)
Expand Down Expand Up @@ -464,7 +472,7 @@ def build_image(
frappe_path=args.frappe_path,
frappe_branch=args.frappe_branch,
apps_json_path=args.apps_json,
image_name=args.image,
tags=args.tags,
containerfile_path=args.containerfile,
python_version=args.python_version,
node_version=args.node_version,
Expand Down

0 comments on commit 97ce6f7

Please sign in to comment.