atomist / sdm-pack-k8s

Extension Pack for an Atomist SDM to integrate Kubernetes deployments
Apache License 2.0
3 stars 2 forks source link

Add repo sync command #71

Closed ddgenome closed 5 years ago

ddgenome commented 5 years ago

Wrap sync repo functionality in a command. Use command to run sync of entire repo as a job so it gets scheduled in a worker.

Fix naming of kube undeploy.

@cdupuis do you think this would work?

ddgenome commented 5 years ago

@cdupuis I see this in the logs:

2019-08-13T11:22:37.996Z [m:10] [debug] Mutating 'https://automation.atomist.com/graphql/team/T095SFFBK' with variables '{"name":"SyncRepoCommand","description":"Executing `SyncRepoCommand`","owner":"@atomist/k8s-sdm_k8s-internal-staging","data":"{\"secrets\":[]}","tasks":[]}' and mutation: mutation CreateJob( $data:
 String! $name: String! $description: String! $owner: String! $tasks: [AtmJobTaskInput!]!) { createAtmJob( jobInput: { data: $data name: $name description: $description owner: $owner jobTasks: $tasks } ) { id }}
…
2019-08-13T11:22:38.312Z [m:10] [debug] Mutation returned data: {"createAtmJob":{"id":"8ddb7dbc-e1ac-4408-9088-235b142a7562"}}

But that id does not appear anywhere else in the logs and I see no logs of the sync ever occurring.

cdupuis commented 5 years ago

For Jobs to work, you need the job support extension pack in your SDM. That gets installed internally but maybe not in your k8s-sdm. Do you see it listed in the start up message?

I’m talking about https://github.com/atomist/sdm-core/blob/master/lib/pack/job/job.ts#L29

ddgenome commented 5 years ago

That's probably it, I'll add that.

ddgenome commented 5 years ago

Is it acceptable to call jobSupport() from a StartupListener, or is that something that has to be handled in configuration post-processors? And is it bad if jobSupport() is called more than once?

ddgenome commented 5 years ago

Calling jobSupport() is not necessary, that is added by default to all SDMs.

ddgenome commented 5 years ago

I did find what appears to be a bug around startupListeners and triggeredListeners, atomist/sdm#762 .