2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-08 16:14:12 +00:00

ci: fix easy-install args in test

This commit is contained in:
Revant Nandgaonkar 2024-10-27 15:20:01 +05:30
parent 18426dbdf1
commit 97ce6f79a9
2 changed files with 21 additions and 13 deletions

View File

@ -28,8 +28,8 @@ jobs:
- name: Perform production easy install - name: Perform production easy install
run: | run: |
python3 ${GITHUB_WORKSPACE}/easy-install.py build --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 erpnext:version-15 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 version --format json
docker compose -p actions_test exec backend bench --site site1.localhost list-apps --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") result=$(curl -H "Host: site1.localhost" -sk https://127.0.0.1/api/method/ping | jq -r ."message")

View File

@ -345,10 +345,12 @@ def add_build_parser(argparser: argparse.ArgumentParser):
default="frappe_docker/development/apps-example.json", default="frappe_docker/development/apps-example.json",
) )
build.add_argument( build.add_argument(
"-i", "-t",
"--image", "--tag",
help="Full Image Name, default: custom-apps:latest", dest="tags",
default="custom-apps:latest", help="Full Image Name(s), default: custom-apps:latest",
action="append",
default=["custom-apps:latest"],
) )
build.add_argument( build.add_argument(
"-c", "-c",
@ -375,7 +377,7 @@ def build_image(
frappe_branch: str, frappe_branch: str,
containerfile_path: str, containerfile_path: str,
apps_json_path: str, apps_json_path: str,
image_name: str, tags: list[str],
python_version: str, python_version: str,
node_version: str, node_version: str,
): ):
@ -397,7 +399,12 @@ def build_image(
which("docker"), which("docker"),
"build", "build",
"--progress=plain", "--progress=plain",
f"--tag={image_name}", ]
for tag in tags:
command.append(f"--tag={tag}")
command += [
f"--file={containerfile_path}", f"--file={containerfile_path}",
f"--build-arg=FRAPPE_PATH={frappe_path}", f"--build-arg=FRAPPE_PATH={frappe_path}",
f"--build-arg=FRAPPE_BRANCH={frappe_branch}", f"--build-arg=FRAPPE_BRANCH={frappe_branch}",
@ -419,8 +426,9 @@ def build_image(
if push: if push:
try: try:
for tag in tags:
subprocess.run( subprocess.run(
[which("docker"), "push", image_name], [which("docker"), "push", tag],
check=True, check=True,
) )
except Exception as e: except Exception as e:
@ -464,7 +472,7 @@ if __name__ == "__main__":
frappe_path=args.frappe_path, frappe_path=args.frappe_path,
frappe_branch=args.frappe_branch, frappe_branch=args.frappe_branch,
apps_json_path=args.apps_json, apps_json_path=args.apps_json,
image_name=args.image, tags=args.tags,
containerfile_path=args.containerfile, containerfile_path=args.containerfile,
python_version=args.python_version, python_version=args.python_version,
node_version=args.node_version, node_version=args.node_version,