mantis-cli 7.0.0__tar.gz → 7.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mantis-cli
3
- Version: 7.0.0
3
+ Version: 7.1.1
4
4
  Summary: Management command to build and deploy webapps, especially based on Django
5
5
  Home-page: https://github.com/PragmaticMates/mantis-cli
6
6
  Author: Erik Telepovský
@@ -0,0 +1 @@
1
+ VERSION = '7.1.1'
@@ -19,7 +19,8 @@ def parse_args():
19
19
  for arg in arguments:
20
20
  if not arg.startswith('-'):
21
21
  d['environment_id'] = arg
22
- elif '=' in arg and ':' not in arg:
22
+ # elif '=' in arg and ':' not in arg:
23
+ elif '=' in arg:
23
24
  s, v = arg.split('=', maxsplit=1)
24
25
  d['settings'][s.strip('-')] = v
25
26
  else:
@@ -55,7 +55,7 @@ class Mantis(object):
55
55
  if hasattr(self, property_name):
56
56
  return getattr(self, property_name)
57
57
 
58
- if 'dev' in self.environment_id:
58
+ if 'local' in self.environment_id:
59
59
  details = {
60
60
  'host': 'localhost',
61
61
  'user': None,
@@ -89,7 +89,7 @@ class Mantis(object):
89
89
 
90
90
  @property
91
91
  def docker_connection(self):
92
- if 'dev' in self.environment_id:
92
+ if 'local' in self.environment_id:
93
93
  return ''
94
94
 
95
95
  if self.mode == 'remote':
@@ -165,7 +165,7 @@ class Mantis(object):
165
165
  self.htpasswd = f'{self.configs_path}/{self.WEBSERVER}/secrets/.htpasswd'
166
166
 
167
167
  def check_environment_encryption(self, env_file):
168
- decrypted_environment = self.decrypt_env(env_file, return_value=True) # .env.encrypted
168
+ decrypted_environment = self.decrypt_env(env_file=env_file, return_value=True) # .env.encrypted
169
169
  loaded_environment = self.load_environment(env_file) # .env
170
170
 
171
171
  if decrypted_environment is None:
@@ -205,10 +205,10 @@ class Mantis(object):
205
205
  else:
206
206
  CLI.danger(decrypted_value, end=' ')
207
207
 
208
- print(f'[{self.environment_file_encrypted_name}]', end='\n')
208
+ print(f'[{env_file}.encrypted]', end='\n')
209
209
 
210
210
  else:
211
- CLI.success('Encrypted and decrypted environments DO match...')
211
+ CLI.success(f'Encrypted and decrypted environments DO match [{env_file}]...')
212
212
 
213
213
  def read_key(self):
214
214
  if not os.path.exists(self.key_file):
@@ -226,14 +226,14 @@ class Mantis(object):
226
226
  CLI.pink(key)
227
227
  CLI.danger(f'Save it to {self.key_file} and keep safe !!!')
228
228
 
229
- def encrypt_env(self, env_file=None, params='', return_value=False):
229
+ def encrypt_env(self, params='', env_file=None, return_value=False):
230
230
  if env_file is None:
231
231
  CLI.info(f'Environment file not specified. Walking all environment files...')
232
232
 
233
233
  values = {}
234
234
 
235
235
  for env_file in self.environment_files:
236
- value = self.encrypt_env(env_file, return_value=return_value)
236
+ value = self.encrypt_env(params=params, env_file=env_file, return_value=return_value)
237
237
  if return_value:
238
238
  values.update(value)
239
239
 
@@ -262,7 +262,7 @@ class Mantis(object):
262
262
  else:
263
263
  encrypted_lines.append(line)
264
264
 
265
- if not return_value:
265
+ if not return_value and 'force' not in params:
266
266
  print(encrypted_lines[-1])
267
267
 
268
268
  if return_value:
@@ -283,14 +283,14 @@ class Mantis(object):
283
283
  else:
284
284
  CLI.warning(f'Save it to {env_file_encrypted} manually.')
285
285
 
286
- def decrypt_env(self, env_file=None, params='', return_value=False):
286
+ def decrypt_env(self, params='', env_file=None, return_value=False):
287
287
  if env_file is None:
288
288
  CLI.info(f'Environment file not specified. Walking all environment files...')
289
289
 
290
290
  values = {}
291
291
 
292
292
  for env_file in self.environment_files:
293
- value = self.decrypt_env(env_file, return_value=return_value)
293
+ value = self.decrypt_env(params=params, env_file=env_file, return_value=return_value)
294
294
  if return_value:
295
295
  values.update(value)
296
296
 
@@ -321,7 +321,7 @@ class Mantis(object):
321
321
  else:
322
322
  decrypted_lines.append(line)
323
323
 
324
- if not return_value:
324
+ if not return_value and 'force' not in params:
325
325
  print(decrypted_lines[-1])
326
326
 
327
327
  if return_value:
@@ -582,8 +582,8 @@ class Mantis(object):
582
582
  else:
583
583
  CLI.error(f'Unknown context "{context}". Available: services, compose, mantis or all')
584
584
 
585
- if self.environment_id == 'dev':
586
- print('Skipping for dev...')
585
+ if self.environment_id == 'local':
586
+ print('Skipping for local...')
587
587
  elif self.mode == 'host':
588
588
  CLI.warning('Not uploading due to host mode! Be sure your configs on host are up to date!')
589
589
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mantis-cli
3
- Version: 7.0.0
3
+ Version: 7.1.1
4
4
  Summary: Management command to build and deploy webapps, especially based on Django
5
5
  Home-page: https://github.com/PragmaticMates/mantis-cli
6
6
  Author: Erik Telepovský
@@ -1 +0,0 @@
1
- VERSION = '7.0.0'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes