From 397866f18b4594745af653cc73ce29258fd271de Mon Sep 17 00:00:00 2001 From: David Boreham Date: Wed, 24 Aug 2022 12:36:58 -0600 Subject: [PATCH] More click refactoring --- app/__pycache__/__init__.cpython-38.pyc | Bin 0 -> 156 bytes app/__pycache__/__init__.cpython-39.pyc | Bin 0 -> 156 bytes .../build_containers.cpython-38.pyc | Bin 0 -> 1430 bytes .../build_containers.cpython-39.pyc | Bin 0 -> 2019 bytes app/__pycache__/deploy_system.cpython-38.pyc | Bin 0 -> 1396 bytes app/__pycache__/deploy_system.cpython-39.pyc | Bin 0 -> 2143 bytes .../setup_repositories.cpython-38.pyc | Bin 0 -> 2908 bytes .../setup_repositories.cpython-39.pyc | Bin 0 -> 3413 bytes app/build_containers.py | 31 ++++++++++-------- app/deploy_system.py | 11 +++++-- 10 files changed, 25 insertions(+), 17 deletions(-) create mode 100644 app/__pycache__/__init__.cpython-38.pyc create mode 100644 app/__pycache__/__init__.cpython-39.pyc create mode 100644 app/__pycache__/build_containers.cpython-38.pyc create mode 100644 app/__pycache__/build_containers.cpython-39.pyc create mode 100644 app/__pycache__/deploy_system.cpython-38.pyc create mode 100644 app/__pycache__/deploy_system.cpython-39.pyc create mode 100644 app/__pycache__/setup_repositories.cpython-38.pyc create mode 100644 app/__pycache__/setup_repositories.cpython-39.pyc diff --git a/app/__pycache__/__init__.cpython-38.pyc b/app/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..42da53cc51514f858c06c228f7ea339563e13285 GIT binary patch literal 156 zcmWIL<>g`kg5t+4$sqbMh(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o6vJKO;XkRX-)M zEHg#FpeR2pHMyi%zpOMTIWaG@DpkL@Br!Q#H@_%3Bel4sD6u5JNI$WlKtDb{GcU6w ZK3=b&@)n0pZhlH>PO2Tq=+8jR000|bCNuy5 literal 0 HcmV?d00001 diff --git a/app/__pycache__/__init__.cpython-39.pyc b/app/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..00879fd41006b78d25492d2a0250fb9cf4c0adc4 GIT binary patch literal 156 zcmYe~<>g`kg5t+4$sqbMh(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o6vJKO;XkRX-)M zEHg#FpeR2pHMyi%zpOMTIWaG@DpkL@Br!Q#H@_%3Bel4sD6u5JNI$WlKtDb{GcU6w ZK3=b&@)n0pZhlH>PO2Tq=+8jR001JdCO`lH literal 0 HcmV?d00001 diff --git a/app/__pycache__/build_containers.cpython-38.pyc b/app/__pycache__/build_containers.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0a58c334d39649cd122c7028c5ace90300cf20a5 GIT binary patch literal 1430 zcmZWp&2J+$6t_K}nI_%c><8sTC_+dmXq%k4psK*OJ?y1G3IdIUMw7AIOm;FeYdcXo zO1QLAQ;8LK&`JrnmH3N%<+T4oPdq#QV1-A1_WSVj@BREVKQ&xuMJ4rME)N9s1Ow_BlGkXE^jI zK0z5YF(uS` zMOOF{Er{5a9<>+fPxP9cVT??azd$Q2df;)4tw!B5{CjhbXLuQ`&~jsi=Hw^z1^OQK z(9dXL@pFjvX5=Qz1-if&7+CR=Qp3i-5^a2CrnKdH8WHW{ZmHKq;p6SJs@siN+nZhPKVaDtI}%^4?q1>T z$~Q_!3@ZO9;b|##=mF;if7%i^hRt_rd#iiv2d>L+6Xl2j%Q9uLd{S-nn1F{c^tS`$ zlswI)B85p(^uJ60WB|7D)dTa6XHnf1> z3sM1_mT-D380SP=_3uYHseo=*c2Tli+0fn;I4!eOX3*TC?Iuq6F$=711%nF@gWH1U4w3eB0dIzY#+l11woOd4!Zz9G5h8{AM;NkqFr0Vz7Kol z$NZ#>xnRntEGfoi#@6tg+Uq1)n!GTlRK1LaFm$r1T;nicj4)vQol!x@8QXmi&I+C0 NV8MU_`wbTe{})e%hSmT8 literal 0 HcmV?d00001 diff --git a/app/__pycache__/build_containers.cpython-39.pyc b/app/__pycache__/build_containers.cpython-39.pyc new file mode 100644 index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oL5gNwegfai&yD!Z zh)pBTfGDecKZ6q?S6oVBtQ*Ga#R^zox+3Fg>6)_$pv;n3Cvb|ZrrSNYs;_6bZo%tT zS4Jf-n_Qn7L5;X%#1|mS%Cg=jD9V@-@$F80yiV#kAXR*gz)s2LMu6p2@HZQade6gq z89;+GIPQ5FFdm5<{yi3TUo>7XO5$j*T)!;``Ix8rp^22GZ@-XbJ!Gs039PTITC363 u0w1&3qFlOqvo!}>W5M!--!d>N;|#F5pRi!4Kw&5%bCxVi3Q1qi zhP3pu2Hmm*0qm{)XZiw(`=$0YZNp z<0>!%##~5@{kcAUF*kDdU7jEp@IWD}|W0bkCQS5VX6KoOp@*eY; z{~F!k8yp7=KSiV9AFzwgM_7AlRldkBVHQ2A(m5ArMaD~&5<}>k@y3CE23kQE;2Qu8cR(RaVg`d<4lW8syOP1R{H}96W|Yz$Fpj|$1J(Z*tix| z&Qm4FSIZ(z%52TYQYGp9q!Q_jOC=IjiE&cbW5(;ET219jD!w?aSNhKFQMZS{hID?< z#A65o;Ui3Oh$9?WDI&m9Y*xC~hp`9Uh7iF@gL0JP7Tb}SAc0O=M>!1A^xI)e8@i!e zv~jnnb$>?p(T`|?o|{n0*r{?0rMO07E^=9W5FBT_E@hC8%KU@ zLKZ^8{{rrx!0j6!nqIz_@3V*v-hftq37kFPd<4$Fz}dg$Y=&F-d7J9t`FaSMg$Roi zlfYATt=30pJLEX67IjrZAwRWR^rX{I*7S6>DAxTSY>i~)<-_B({~{|m z?1G9ObiApBVmgClYqG4@hm&Pl0)2Ok5okk$I3Y-b znm+7CYhx6O&%uBW;JVg{fG`D&r`579xG?WaJgir0R+UruUd<9nn+=0@(;`dfyPz3g sbW|r&PT{3e{91kDt@Ycutb=bB63lDtz4}(r_>Hq)$ literal 0 HcmV?d00001 diff --git a/app/__pycache__/deploy_system.cpython-39.pyc b/app/__pycache__/deploy_system.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..82705c0df61e1e343be1f604c42d9f7d85c30ed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 zSTe0OOoADMuahpD4x&5YinK5Q2L2R=yaU9rn&g&glMUO}J?koI1J^}~)ij$RbD^WT zqznBF-@RRN1FT9HnoSxAXe%ydA1aoyYzLGM!LME`Eoj8$0g7gs%7Qqa4>gQsbjpS!0U^uU>ebZtXeo91 z#fPvF@evXa2_}502>3w|Sc%g8V#a9}voE)SlZQYs-8Qyw({0+s{M)hiAobM`i_kS) J(;<$g{{RPmRf_-s literal 0 HcmV?d00001 diff --git a/app/__pycache__/setup_repositories.cpython-38.pyc b/app/__pycache__/setup_repositories.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..37c8fa4fd023ac3bf9f69e94fd562465a240f3ea GIT binary patch literal 2908 zcmY*b&5qp05$-0NKg;=%yjly9<2Zy7$C^aDgCs}}f?x=-Y$J#;c2;ui5C{k^yJwfP z9FpqpS?m%sx$FWv0wP3*+zbOVx#^N;$RQ7qTMS-vQXU`&U!1C*S!+y!&FbpvVpr8y zRs6Km2?$*O9=qv(uMzSeoNQh$Ozy*@p2NTir#XpMZyHfEw;~JPR&I}3#OP|xi5%eB zxjS|vcg^!6?<2w)cPmMe^bxud?5Q5;@BkPh3DW}}J@FSah z+~Mv8jo2k&ByvEz-?To;^e3`BltQVLZs)P@*kV3Ag>so|4$+ z1XQs>Lx26aXGd&OWV&$@m1bEK;3QUQl8YW|95tzgZ2UORkR3}@-mvN*k!Y3@`S1m8 zw&FO=6Q$z#1^N27{iAX$`aC(wc)yb6NTgczPbPVq6j?3$N+;>@ZYk3vp|nhNDf>xP z^_9?*Dwd)uRR+9FsJ-e;`tZ3o(H;f^p#iOTHq76JUS z$?2N(#t@I>P{X6ipagXJRmUK$W#A-0Z}oc zPnmgJPo4GK(qQYt(XL4!`aEt0EntHrNuZL%5og4aw1a^`42w$eZ2qi$B%3GPyJNLRQ?dWRd*hU zlW@N*b(pEUVf_=FN}NKZA>B)P7V=W4;$0nz(@g0*VJbzUv*NJ6@$HGuc5_(T)2F)j z3>xl+-vJ~B2^0ASJnA-7Hx6J#=gi=}0N5=lw{MY|r2(J|dk)FHv}U%Mv8lbJGX|mH zQzjpBrk#b0ype|*3X3~42iy(3F9q*u21RIp0npvUfSCdEU9@TR|N6)oz#-0Ok6I*|S=>+SGdunpc%WA+ky(v4=El zRAxovWC~C!ZvjWX0YlVTxgcJ-pm8b*T1{1HY)FZQ0faTSgK?>aYFubehoFby8BH0D z0`ut@6Q}1j46Tk{AHp)$Er@_AT``uo$j8M2)b{9>5g2Bd2gcrK;PJ}!t)w(&EstS6` z6k3+~>_d=Mzk&fB4 zkCS5o5raUKl>omZe4D_;HqQ#7z~y$TPh}sspw-dNE8N9cV`B7jfBf zQpO|R+6X+QdK(7fVXOA79m}O%3ti&VzzXP1FurTueA}n;9!T}ND|324H$I%cN~D6) z$p!o*KxH*%t?-8Zrg73dOOK=Oz5&!HYv3Cs8Ppl20JBPGWzn=N{ISC1!uY@H?S?Yv e_V2C!5Z*I|5+QAl4Kaj9569mQ{I&}e8t{L8c>?PI literal 0 HcmV?d00001 diff --git a/app/__pycache__/setup_repositories.cpython-39.pyc b/app/__pycache__/setup_repositories.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f21b25d80e27a3db2aab9e43bbe028e365d3be3b GIT binary patch literal 3413 zcmY*bPjB4D6`$e1rB*9hwv;q(lYj`&#_L*=(*{Lr1VIwp4T1)WAqOc+pde_@ti&~! zT+a*@iC7f{WWX{|BRMw>AOXGj*3ZyWKR`}IZaw)c_|WwChLW@9g0u5x-aO9xy}#+w zQlH`Z>hFHGdy%pK5;6byAU?pWzr!Gy;024je;#v7JF$a*r*J1;?D1~TkA1AUMKB5C z;B2iI_daIA6aGUceCdzFBR5_Uf#^MCabG&)MG=Yx(SPE^134HkiA6CGOJezn%bBGw zfL@uSFM_@_N3Vijo1~R{#A^@P5sy~{zsrV~pFuOWHRNrO zRplt(!OSxc#3ZBj`NusY^e-@xjP#G4M{L9e7tX^lc12J4B6!GS?-BD@>_d9kE`FSw zJF41IQtOP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G={6pV_0&Cwe z0OVuUBLKkty;&eI^xv=_+Wm!ZEjXrsvMBmwjPi~_$yeV4;D3T^k+{wbIT$bN@6NwQ z#u{H3uN(%mV7zq9)qeylJ#+DhiNO<+6XNtz_ua3#z6yEIv9e4C6Bn#hdnYOxk0Ft&s(yS3LZZ#K>w?4qTTi@G2D!TEUZ$A40PxIzW{*4$! zXz$7Bo=VGX7ZzRJl9D0^xlBeQX%La3>EEO%h7rNw;O*Jmipdpg?WlwUpd~RW#Siin zQgK9y^GAz6qaLDpWxFm*iYeOcf)BZE$m0;H(Doh8r7JJ?^!Q*)ojsLUuJ{j;W7YHAT-L(HacSCW(>zMr}fcr*6C?X$TJ#n6V6^uC0NfP6KTC83uJ6e}`jk(W{ry?E_M&q^qlB!pV*+g0^0iK0HEQ~Mp7 z*^1vgyY6qXq9Y8<4WQB*)LeE*btvZa`Bf;n?5w;Ma&-ed!;9U$uVLPXaDyr8u#7_? z(W;@wclWpcM3tcRvm(##$IIK+G47l>w)Kn7tCl}hJM{#nyhDOi8(4v=9i&1ekZD^i*>JasUP+{^fk`^0&fLowLd3>*8c}s C*{f&( literal 0 HcmV?d00001 diff --git a/app/build_containers.py b/app/build_containers.py index d1cc3c7..b0bb229 100644 --- a/app/build_containers.py +++ b/app/build_containers.py @@ -27,25 +27,28 @@ from decouple import config import subprocess import click -parser = argparse.ArgumentParser( - description="build the set of containers required for a complete stack", - epilog="Config provided either in .env or settings.ini or env vars: CERC_REPO_BASE_DIR (defaults to ~/cerc)" - ) -parser.add_argument("--verbose", action="store_true", help="increase output verbosity") -parser.add_argument("--quiet", action="store_true", help="don\'t print informational output") -parser.add_argument("--check-only", action="store_true", help="looks at what\'s already there and checks if it looks good") -parser.add_argument("--dry-run", action="store_true", help="don\'t do anything, just print the commands that would be executed") +#parser = argparse.ArgumentParser( +# description="build the set of containers required for a complete stack", +# epilog="Config provided either in .env or settings.ini or env vars: CERC_REPO_BASE_DIR (defaults to ~/cerc)" +# ) +#parser.add_argument("--verbose", action="store_true", help="increase output verbosity") +#parser.add_argument("--quiet", action="store_true", help="don\'t print informational output") +#parser.add_argument("--check-only", action="store_true", help="looks at what\'s already there and checks if it looks good") +#parser.add_argument("--dry-run", action="store_true", help="don\'t do anything, just print the commands that would be executed") -args = parser.parse_args() +#args = parser.parse_args() @click.command() -def command(): - verbose = args.verbose - quiet = args.quiet +@click.pass_context +def command(ctx): + + quiet = ctx.obj.quiet + verbose = ctx.obj.verbose + dry_run = ctx.obj.verbose dev_root_path = os.path.expanduser(config("CERC_REPO_BASE_DIR", default="~/cerc")) - if not args.quiet: + if not quiet: print(f'Dev Root is: {dev_root_path}') if not os.path.isdir(dev_root_path): @@ -66,7 +69,7 @@ def command(): if not os.path.exists(build_script_filename): print(f"Error, script: {build_script_filename} doesn't exist") sys.exit(1) - if not args.dry_run: + if not dry_run: # We need to export CERC_REPO_BASE_DIR build_result = subprocess.run(build_script_filename, shell=True, env={'CERC_REPO_BASE_DIR':dev_root_path}) # TODO: check result in build_result.returncode diff --git a/app/deploy_system.py b/app/deploy_system.py index 7c2195a..606280d 100644 --- a/app/deploy_system.py +++ b/app/deploy_system.py @@ -51,7 +51,12 @@ def include_exclude_check(s, args): #print("Yo2!") @click.command() -def command(): +@click.pass_context +def command(ctx): + + quiet = ctx.obj.quiet + verbose = ctx.obj.verbose + dry_run = ctx.obj.verbose with open("cluster-list.txt") as cluster_list_file: clusters = cluster_list_file.read().splitlines() @@ -76,8 +81,8 @@ def command(): # See: https://gabrieldemarmiesse.github.io/python-on-whales/sub-commands/compose/ docker = DockerClient(compose_files=compose_files) - command = args.command[0] - if not args.dry_run: + command = "hack" + if not dry_run: if command == "up": if verbose: print("Running compose up")