Skip to content

add daily suscription job for calendar-agent #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions resources/apps/calendar-agent/calendar-agent.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as config from './config';
import * as gcp from '@pulumi/gcp';
import * as google from '@pulumi/google-native';
import { developers } from '../../config';
import { project } from '../../google/project';
import { providers, provider } from '../../google/providers';
Expand Down Expand Up @@ -41,11 +42,17 @@ export const domainMapping = new gcp.cloudrun.DomainMapping(
{ provider: provider.gcp },
);

// export const domainMapping = new google.run.v1.DomainMapping(config.name, {
// project,
// location: config.location,
// kind: 'DomainMapping',
// apiVersion: 'domains.cloudrun.com/v1',
// metadata: { name: config.domain },
// spec: { routeName: service.service.name },
// });
export const job = new google.cloudscheduler.v1.Job(
'calendar-agent-daily-subscription-job',
{
location: config.location,
description: 'Ensure subscription to all calendars enrolled with calendar-agent',
schedule: '0 12 * * *',
timeZone: 'Europe/Oslo',
httpTarget: {
httpMethod: 'GET',
uri: new URL('/subscribe-all', config.selfUrl).toString(),
},
},
{ deleteBeforeReplace: true, provider: provider.google },
);