1
0
mirror of https://github.com/Adam-Ant/drone-trigger synced 2024-11-05 05:36:23 +00:00

Add checking to see if task sent sucessfully

This prevents a new current value being written if it did not succeed,
allowing it to be retried after the wait period.
This commit is contained in:
Adam Dodman 2017-07-17 17:03:20 +01:00
parent bde153cfdc
commit bb0721b645

View File

@ -139,10 +139,11 @@ if __name__ == '__main__':
branch = 'master'
else:
branch = config[service]['branch']
runbuild(config[service].get('drone_repo'), branch)
config[service]['current_value'] = new_value
with open(filepath + '/dronetrigger.cfg', 'w') as configfile:
config.write(configfile)
if (runbuild(config[service].get('drone_repo'), branch)):
config[service]['current_value'] = new_value
with open(filepath + '/dronetrigger.cfg', 'w') as configfile:
config.write(configfile)
print("Successfully build new version for " + service)
except:
raise