Skip to content

feat(ci): Add image build and publish configs for sample services#89

Merged
grayside merged 2 commits into
masterfrom
publish-configs
Apr 19, 2024
Merged

feat(ci): Add image build and publish configs for sample services#89
grayside merged 2 commits into
masterfrom
publish-configs

Conversation

@grayside
Copy link
Copy Markdown
Contributor

@grayside grayside commented Apr 3, 2024

This change brings the configuration of the container image build pipeline into the repository, and creates space for further customizations later.

  • Add Cloud Build configurations to build & publish the Hello and Placeholder service sample images.
  • Add set -x to script steps in Hello job build

Decision: cloudbuild.yaml per container build

Context

This repository hosts three apps that need to be built and published with a container image. This codebase is inconsistently organized, with two workloads tangled at the root directory and a third in a dedicated subdirectory.

  • hello-job is in job/
  • hello and placeholder are at the repository root

The services at the root share Go code for a web server and they cannot be separated without code duplication or further refactoring.

This means we have three very similar cloudbuild.yaml configurations, two of which are targeting the same build directory.

Options

  • 1 cloudbuild.yaml: least amount of configuration, but any one build failure will disrupt publishing the others.
  • 2 cloudbuild.yaml: One for jobs and one for the "services". This would align the build configuration with the directory structure, but if we ever split apart the hello and placeholder services it will require careful refactoring or split up of a the pipeline configuration.
  • 3 cloudbuild.yaml: Each app has it's own build configuration. The logic in each is very simple, refactoring of the build pipeline should have the least entanglements or side effects, and any problems in refactoring the apps will be have high visibility for troubleshooting.

Revisiting

If the configurations grow significantly with common configurations, that may be grounds to combine them, but there are alternatives such as adding a reusable shell script to the repository that could be called from each separate configuration.

@grayside grayside self-assigned this Apr 3, 2024
@grayside grayside requested a review from a team April 3, 2024 17:09
@iennae
Copy link
Copy Markdown

iennae commented Apr 19, 2024

s/The code for these 3 workloads is effectively two codebases./The code in this repository is inconsistently organized./

@grayside grayside merged commit 2447ee1 into master Apr 19, 2024
@grayside grayside deleted the publish-configs branch April 19, 2024 22:45
danistrebel pushed a commit to danistrebel/cloud-run-hello that referenced this pull request Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants