feat: run jobs on every tf apply #46
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requires GoogleCloudPlatform/avocano#164 to be merged, released, and the new version referenced
Resolves #44
Cloud Run jobs are run through the metadata startup script on the GCE instance. Previously, when this terraform was first applied, this gce instance would stay on, and subsequent
terraform applycommands would only alter the state of the job or gce instance, but would not restart the instance, so the job execution would not be performed again.With this change, after the gce instance has completed it's tasks, it shuts itself down. The TF designed state is running, so any time terraform is run, the instance will be restarted, and the jobs re-run. The change in avocano now ensures all these jobs are idempotent (previously, re-running the setup job would create duplicate products).
This change now reasserts server image, client deploy, and database migrations.
(Note: the setup script includes base
migrate/collectstaticcommands, as well as database seeding. It's that seeding that's now idempotent)