aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra
diff options
context:
space:
mode:
authorGravatar Oliver Chang <oliverchang@users.noreply.github.com>2020-08-11 18:27:18 +1000
committerGravatar GitHub <noreply@github.com>2020-08-11 18:27:18 +1000
commit0987ddf994e06dd663954e8b65fdb74653b60b2f (patch)
tree16d8842f3406ebf517c4efa29c7d39c9e7f12b86 /infra
parentade417ba20fb52e1340a1ee06e7272fc664fbed8 (diff)
even more fixes. (#4297)
Diffstat (limited to 'infra')
-rwxr-xr-xinfra/build/functions/deploy.sh4
-rw-r--r--infra/build/functions/project_sync.py11
2 files changed, 9 insertions, 6 deletions
diff --git a/infra/build/functions/deploy.sh b/infra/build/functions/deploy.sh
index 4af7f173..ea094e3b 100755
--- a/infra/build/functions/deploy.sh
+++ b/infra/build/functions/deploy.sh
@@ -77,9 +77,11 @@ function deploy_cloud_function {
gcloud functions deploy $name \
--entry-point $entry_point \
--trigger-topic $topic \
- --runtime python37 \
+ --runtime python38 \
--project $project \
--timeout 540 \
+ --region us-central1 \
+ --set-env-vars GCP_PROJECT=$project,FUNCTION_REGION=us-central1 \
--max-instances 1
}
diff --git a/infra/build/functions/project_sync.py b/infra/build/functions/project_sync.py
index 5cff6620..7e887156 100644
--- a/infra/build/functions/project_sync.py
+++ b/infra/build/functions/project_sync.py
@@ -73,21 +73,21 @@ def delete_scheduler(cloud_scheduler_client, project_name):
cloud_scheduler_client.delete_job(name)
-def update_scheduler(cloud_scheduler_client, project, schedule):
+def update_scheduler(cloud_scheduler_client, project, schedule, tag):
"""Updates schedule in case schedule was changed."""
project_id = os.environ.get('GCP_PROJECT')
location_id = os.environ.get('FUNCTION_REGION')
parent = cloud_scheduler_client.location_path(project_id, location_id)
job = {
- 'name': parent + '/jobs/' + project.name + '-scheduler',
+ 'name': parent + '/jobs/' + project.name + '-scheduler-' + tag,
'pubsub_target': {
'topic_name': 'projects/' + project_id + '/topics/request-build',
'data': project.name.encode()
},
- 'schedule': project.schedule
+ 'schedule': schedule,
}
- update_mask = {'schedule': schedule}
+ update_mask = {'paths': ['schedule']}
cloud_scheduler_client.update_job(job, update_mask)
@@ -138,7 +138,8 @@ def sync_projects(cloud_scheduler_client, projects):
try:
logging.info('Schedule changed.')
update_scheduler(cloud_scheduler_client, project,
- projects[project.name].schedule)
+ projects[project.name].schedule,
+ build_project.FUZZING_BUILD_TAG)
project.schedule = project_metadata.schedule
project_changed = True
except exceptions.GoogleAPICallError as error: