Allow pre-configuring channels without a running instance
dhirschfeld opened this issue · 2 comments
dhirschfeld commented
I guess the channel information is kept in the database? This would therefore enable the CLI to directly manipulate the database without having to go through the REST api.
dhirschfeld commented
It would be ideal to be able to specify an initial set of channels in the config file
dhirschfeld commented
For now I've hacked it in my dockerfile:
RUN quetz create /home/user/quetz
WORKDIR /home/user/quetz
RUN python <<EOF
from quetz.database import get_session
from quetz.db_models import Channel
session = get_session("sqlite:///./quetz.sqlite")
for env in ('dev', 'uat', 'prod'):
channel = Channel(
name=f"seau/{env}",
description=f"Conda channel for the {env.upper()} environment."
)
session.add(channel)
session.commit()
session.close()
EOF