Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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: |
Expand Down
1 change: 0 additions & 1 deletion base/dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ epdb
py-spy
pydevd_pycharm
django-extensions
pulp-cli
15 changes: 2 additions & 13 deletions base/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions client/oci_env/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 0 additions & 8 deletions client/oci_env/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
pulpcore_manager,
profile,
poll,
pulp,
phelper
)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand Down