feat: skip installation
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

ref: ForgeFlux/ftest-control#2
This commit is contained in:
Aravinth Manivannan 2023-10-13 15:54:42 +05:30
parent 40899951ad
commit 02cef0aeaf
Signed by: realaravinth
GPG key ID: F8F50389936984FF
3 changed files with 0 additions and 65 deletions

View file

@ -24,7 +24,6 @@ class Forgejo:
self.c = c self.c = c
self.parser = parser self.parser = parser
self.subparser = self.parser.add_subparsers() self.subparser = self.parser.add_subparsers()
self.install()
self.register() self.register()
self.login() self.login()
self.create_repository() self.create_repository()
@ -39,17 +38,6 @@ class Forgejo:
group.add_argument("email", type=str, help="Forgejo user's email") group.add_argument("email", type=str, help="Forgejo user's email")
group.add_argument("host", type=str, help="URI at which Forgejo is running") group.add_argument("host", type=str, help="URI at which Forgejo is running")
def install(self):
def run(args, c: Session):
forgejo = forgejo_from_args(args, c=c)
forgejo.install()
self.install_parser = self.subparser.add_parser(
name="install", description="Install Forgejo", help="Install Forgejo"
)
self.__add_credentials_parser(self.install_parser)
self.install_parser.set_defaults(func=run)
def register(self): def register(self):
def run(args, c: Session): def run(args, c: Session):
forgejo = forgejo_from_args(args, c=c) forgejo = forgejo_from_args(args, c=c)

View file

@ -71,54 +71,6 @@ class Forgejo:
count += 1 count += 1
continue continue
def install(self):
"""
Install Forgejo, first form that a user sees when a new instance is
deployed
"""
parsed = urlparse(self.host)
# cwd = os.environ.get("PWD")
# user = os.environ.get("USER")
payload = {
"db_type": "sqlite3",
"db_host": "localhost:3306",
"db_user": "root",
"db_passwd": "",
"db_name": "forgejo",
"ssl_mode": "disable",
"db_schema": "",
"charset": "utf8",
"db_path": "/data/gitea/gitea.db",
"app_name": "Forgejo:+Beyond+Coding+We+Forge",
"repo_root_path": "/data/git/repositories",
"lfs_root_path": "/data/git/lfs",
"run_user": "git",
"domain": parsed.netloc,
"ssh_port": "22",
"http_port": "3000",
"app_url": self.get_uri(""),
"log_root_path": "/data/gitea/log",
"smtp_host": "",
"smtp_from": "",
"smtp_user": "",
"smtp_passwd": "",
"enable_federated_avatar": "on",
"enable_open_id_sign_in": "on",
"enable_open_id_sign_up": "on",
"default_allow_create_organization": "on",
"default_enable_timetracking": "on",
"no_reply_address": "noreply.localhost",
"password_algorithm": "pbkdf2",
"admin_name": self.username,
"admin_passwd": self.password,
"admin_confirm_passwd": self.password,
"admin_email": self.email,
}
resp = self.c.post(self.get_uri(""), data=payload, allow_redirects=False)
sleep(10)
def get_csrf_token(self, url: str) -> str: def get_csrf_token(self, url: str) -> str:
""" """
Get CSRF token at a URI Get CSRF token at a URI

5
lib.sh
View file

@ -42,11 +42,6 @@ wait_for_env() {
# register root user on Forgejo to simulate Hoste admin and integrate SSO # register root user on Forgejo to simulate Hoste admin and integrate SSO
forgejo_root(){ forgejo_root(){
# python -m forgejo \
# forgejo install \
# $FORGEJO_ROOT_USERNAME $FORGEJO_ROOT_PASSOWRD \
# $FORGEJO_ROOT_EMAIL \
# $FORGEJO_URL
python -m forgejo \ python -m forgejo \
forgejo register \ forgejo register \
$FORGEJO_ROOT_USERNAME $FORGEJO_ROOT_PASSOWRD \ $FORGEJO_ROOT_USERNAME $FORGEJO_ROOT_PASSOWRD \