Verified Commit ae34fdbc authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

extensive logging

parent 5be5c0b6
Pipeline #31985 passed with stages
in 2 minutes and 20 seconds
......@@ -58,9 +58,7 @@ class AutoDeploy(Resource):
projectName = body['project']['path_with_namespace'].split('/')[-1]
repositoryUrl = body['project']['git_http_url']
repositoryPath = body['project']['path_with_namespace']
app.logger.info(
'deploy-request received from '' + repositoryUrl + '''
)
app.logger.info('deploy-request received from ' + repositoryUrl)
app.logger.debug('removing workdir')
shutil.rmtree('autodeploy-workdir/', ignore_errors=True)
......@@ -201,11 +199,16 @@ def installFromRepo(pullChartUri, projectName):
app.logger.warning(msg)
return output, 'failure'
pulledChartsDir += projectName
# TODO: Remove later
print(pulledChartsDir)
if os.path.exists(pulledChartsDir + '/helm-values'):
app.logger.debug('helm value files detected')
# TODO: Change to debug later
app.logger.info('helm value files detected')
for filename in os.listdir(pulledChartsDir + '/helm-values/'):
filenameBase = os.path.splitext(filename)[0]
if '-prod.' in filename or '-stage.' in filename:
# TODO: Remove later
app.logger.info('upgrade installation for ' + filename)
msg, status = _upgrade_installation(
pullChartUri, projectName, filenameBase, filename
)
......@@ -218,7 +221,7 @@ def installFromDir(repositoryUrl, projectName):
status = ''
app.logger.debug('cloning repository')
try:
proc = subprocess.run(
subprocess.run(
'git clone ' + repositoryUrl + ' autodeploy-workdir/',
shell=True,
capture_output=True,
......@@ -226,9 +229,7 @@ def installFromDir(repositoryUrl, projectName):
check=True,
)
output.append(
'git clone {}: {} (stderr: {})'.format(
repositoryUrl, proc.stdout, proc.stderr
)
'git clone {}'.format(repositoryUrl)
)
except subprocess.CalledProcessError as ex:
msg = 'cloning git repo failed with return code {} -- STDOUT: {} -- STDERR: {}'.format(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment