a
This commit is contained in:
		
					parent
					
						
							
								b38fb3b8a1
							
						
					
				
			
			
				commit
				
					
						83ba3944d5
					
				
			
		
					 1 changed files with 6 additions and 2 deletions
				
			
		| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
import click
 | 
					import click
 | 
				
			||||||
import subprocess
 | 
					import subprocess
 | 
				
			||||||
 | 
					import os
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from app.helper import clone, clone_common,\
 | 
					from app.helper import clone, clone_common,\
 | 
				
			||||||
                       clone_etcd_wrapper, pipenv_install
 | 
					                       clone_etcd_wrapper, pipenv_install
 | 
				
			||||||
| 
						 | 
					@ -10,6 +10,7 @@ def api():
 | 
				
			||||||
    pass
 | 
					    pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@api.command("setup")
 | 
					@api.command("setup")
 | 
				
			||||||
 | 
					@click.option("--path", required=True)
 | 
				
			||||||
@click.option("--auth_name", required=True)
 | 
					@click.option("--auth_name", required=True)
 | 
				
			||||||
@click.option("--auth_seed", required=True)
 | 
					@click.option("--auth_seed", required=True)
 | 
				
			||||||
@click.option("--auth_realm", required=True)
 | 
					@click.option("--auth_realm", required=True)
 | 
				
			||||||
| 
						 | 
					@ -17,7 +18,10 @@ def api():
 | 
				
			||||||
@click.option("--otp_server", default="https://otp.ungleich.ch/ungleichotp/",
 | 
					@click.option("--otp_server", default="https://otp.ungleich.ch/ungleichotp/",
 | 
				
			||||||
              help="URL of ungleich OTP server")
 | 
					              help="URL of ungleich OTP server")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def setup(auth_name, auth_seed, auth_realm, realm_allowed, otp_server):
 | 
					def setup(path, auth_name, auth_seed, auth_realm,
 | 
				
			||||||
 | 
					          realm_allowed, otp_server):
 | 
				
			||||||
 | 
					    os.chdir(path)
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    if clone("https://code.ungleich.ch/ungleich-public/ucloud-api.git"):
 | 
					    if clone("https://code.ungleich.ch/ungleich-public/ucloud-api.git"):
 | 
				
			||||||
        with open(".env", "w") as env_file:
 | 
					        with open(".env", "w") as env_file:
 | 
				
			||||||
            lines = [f"AUTH_NAME={auth_name}",
 | 
					            lines = [f"AUTH_NAME={auth_name}",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue