mirror of
https://github.com/status-im/cabot.git
synced 2025-02-24 10:28:06 +00:00
Fix migration requiring jenkins environment variables are set
This commit is contained in:
parent
89e9290200
commit
6e19dad41c
1
CHANGES
1
CHANGES
@ -1,6 +1,7 @@
|
||||
master
|
||||
------
|
||||
|
||||
* Fix migration requiring jenkins environment variables are set
|
||||
* Reduce time to store old check results to 7 days
|
||||
- Currently stores for 2 months, but there's no actual way to view the old data.
|
||||
|
||||
|
@ -15,12 +15,15 @@ def move_old_jenkins_checks(apps, schema_editor):
|
||||
JenkinsCheck = apps.get_model("cabotapp", "JenkinsCheck")
|
||||
JenkinsConfig = apps.get_model("cabotapp", "JenkinsConfig")
|
||||
|
||||
if not JenkinsStatusCheck.objects.exists():
|
||||
return
|
||||
|
||||
if not JenkinsConfig.objects.exists():
|
||||
JenkinsConfig.objects.create(
|
||||
name="Default Jenkins",
|
||||
jenkins_api=os.environ.get("JENKINS_API"),
|
||||
jenkins_user=os.environ.get("JENKINS_USER"),
|
||||
jenkins_pass=os.environ.get("JENKINS_PASS"),
|
||||
jenkins_api=os.environ.get("JENKINS_API", "http://jenkins.example.com"),
|
||||
jenkins_user=os.environ.get("JENKINS_USER", ""),
|
||||
jenkins_pass=os.environ.get("JENKINS_PASS", ""),
|
||||
)
|
||||
|
||||
default_config = JenkinsConfig.objects.first()
|
||||
|
Loading…
x
Reference in New Issue
Block a user