Skip to content
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

Fix/Install Packer plugins when building the observatory image #641

Merged
merged 2 commits into from
Oct 3, 2023

Conversation

alexmassen-hane
Copy link
Contributor

Forgot to add this with the recent Packer upgrade. The new observatory-image.json.pkr.hcl file relies on external plugins to be installed first before the observatory-image can be built. I did this manually before when I upgraded so I missed it adding it to the platform.

I've tested it with a fresh Packer installation and I've added a unit test to suit.

Please review and edit as needed.

@codecov
Copy link

codecov bot commented Sep 22, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (9a6ad37) 87.14% compared to head (90926b8) 87.16%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #641      +/-   ##
===========================================
+ Coverage    87.14%   87.16%   +0.01%     
===========================================
  Files           34       34              
  Lines         4691     4697       +6     
  Branches       572      572              
===========================================
+ Hits          4088     4094       +6     
  Misses         486      486              
  Partials       117      117              
Files Coverage Δ
...bservatory/platform/terraform/terraform_builder.py 86.27% <100.00%> (+0.85%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

"""Install the necessary plugins for packer."""

# Install the Packer plugins by doing an init on the observatory image config file
args = ["packer", "init", "observatory-image.json.pkr.hcl"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the image config file always in the same directory that the packer script is being run? Would it be better to supply the absolute path?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is OK because the current working directory is set below cwd=self.terraform_build_path

@jdddog jdddog force-pushed the fix/packer-init-install-plugins branch from acd7369 to 90926b8 Compare October 3, 2023 20:50
Copy link
Contributor

@jdddog jdddog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this Alex

"""Install the necessary plugins for packer."""

# Install the Packer plugins by doing an init on the observatory image config file
args = ["packer", "init", "observatory-image.json.pkr.hcl"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is OK because the current working directory is set below cwd=self.terraform_build_path

@jdddog jdddog enabled auto-merge October 3, 2023 20:51
@jdddog jdddog added this pull request to the merge queue Oct 3, 2023
Merged via the queue into develop with commit 35360c7 Oct 3, 2023
@jdddog jdddog deleted the fix/packer-init-install-plugins branch October 20, 2023 03:49
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