diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c17a5dc..dd7a152 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -77,6 +77,11 @@ jobs: run: | cp -r oci_env/.github/assets/profiles/* oci_env/profiles/ + - name: install pulp-cli + run: | + pip install pulp-cli + pulp config create --base-url http://localhost:5001 --api-root /my/custom/api/ --username admin --password password + - name: install oci-env cli run: | pip install -e oci_env/client/ @@ -93,25 +98,25 @@ jobs: oci-env -e custom.env poll --wait 5 --attempts 5 - name: Create some dummy data with the pulp CLI (retry up to 5 times because it's sometimes not actually ready) - run: for i in $(seq 1 5); do oci-env pulp file repository create --name test1 && s=0 && break || s=$? && sleep 5; done; (exit $s) + run: for i in $(seq 1 5); do pulp --refresh-api file repository create --name test1 && s=0 && break || s=$? && sleep 5; done; (exit $s) - name: Snapshot the DB run: oci-env db snapshot - name: Create some dummy data with the pulp CLI - run: oci-env -v pulp file repository create --name test2 + run: pulp file repository create --name test2 - name: Test DB restore. Test that test1 exists and test2 doesn't run: | oci-env db restore - oci-env pulp file repository show --name test1 - if oci-env pulp file repository show --name test2; then false; fi + pulp file repository show --name test1 + if pulp file repository show --name test2; then false; fi - name: Test DB Reset. Test that test1 and test2 are gone run: | oci-env db reset - if oci-env pulp file repository show --name test1; then false; fi - if oci-env pulp file repository show --name test2; then false; fi + if pulp file repository show --name test1; then false; fi + if pulp file repository show --name test2; then false; fi - name: Test that the correct plugins are installed and that the API_ROOT was successfully changed. run: | diff --git a/base/dev_requirements.txt b/base/dev_requirements.txt index 0fd62b6..f53a5f9 100644 --- a/base/dev_requirements.txt +++ b/base/dev_requirements.txt @@ -4,4 +4,3 @@ epdb py-spy pydevd_pycharm django-extensions -pulp-cli diff --git a/base/init.sh b/base/init.sh index 3b8ac86..170be15 100755 --- a/base/init.sh +++ b/base/init.sh @@ -2,20 +2,9 @@ pulpcore-manager createsuperuser --no-input --email admin@example.com || true -export PULP_API_ROOT="$(bash "/opt/oci_env/base/container_scripts/get_dynaconf_var.sh" API_ROOT)" - -if ! pulp --refresh-api status +if ! grep -q "install_phelpers.sh" /root/.bashrc then - pulp config create --overwrite --base-url "http://localhost:${NGINX_PORT}" --api-root "${PULP_API_ROOT}" --username "${DJANGO_SUPERUSER_USERNAME}" --password "${DJANGO_SUPERUSER_PASSWORD}" - if ! grep -q "_PULP_COMPLETE=bash_source pulp" /root/.bashrc - then - echo "eval \"\$(LC_ALL=C _PULP_COMPLETE=bash_source pulp)\"" >> /root/.bashrc - fi - if ! grep -q "install_phelpers.sh" /root/.bashrc - then - echo "source /opt/oci_env/base/container_scripts/install_phelpers.sh" >> /root/.bashrc - fi - pulp --refresh-api status + echo "source /opt/oci_env/base/container_scripts/install_phelpers.sh" >> /root/.bashrc fi # Configure sudo diff --git a/client/oci_env/commands.py b/client/oci_env/commands.py index dac3c21..31e7c59 100644 --- a/client/oci_env/commands.py +++ b/client/oci_env/commands.py @@ -199,10 +199,6 @@ def poll(args, client): client.poll(args.attempts, args.wait) -def pulp(args, client): - exit(client.exec(["pulp"] + args.command, interactive=False).returncode) - - def phelper(args, client): if args.action in ("help", "status", "dbreset", "clean"): proc = client.exec(["bash", "-lc", f"p{args.action}"], shell=True) diff --git a/client/oci_env/main.py b/client/oci_env/main.py index 3d1d569..55961ec 100644 --- a/client/oci_env/main.py +++ b/client/oci_env/main.py @@ -11,7 +11,6 @@ pulpcore_manager, profile, poll, - pulp, phelper ) @@ -55,7 +54,6 @@ def get_parser(): parse_pulpcore_manager_command(subparsers) parse_profile_command(subparsers) parse_poll_command(subparsers) - parse_pulp_cli_command(subparsers) parse_phelper_commands(subparsers) return parser @@ -150,12 +148,6 @@ def parse_poll_command(subparsers): parser.set_defaults(func=poll) -def parse_pulp_cli_command(subparsers): - parser = subparsers.add_parser('pulp', help='Run pulp cli.') - parser.add_argument('command', nargs=argparse.REMAINDER, help='Command to pass to pulp cli.') - parser.set_defaults(func=pulp) - - def parse_phelper_commands(subparsers): for action in ("start", "stop", "restart"): parser = subparsers.add_parser(f'p{action}', help=f'{action.capitalize()} all/any Pulp service')