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

Adding linux VM support for packer build task #3754

Merged
merged 7 commits into from
Mar 10, 2017

Conversation

bishal-pdMSFT
Copy link
Contributor

Also tested that this task run properly on linux agent

@msftclas
Copy link

msftclas commented Mar 8, 2017

@bishalpd,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@bishal-pdMSFT bishal-pdMSFT requested a review from sachinma March 8, 2017 11:29
},
{
"type": "shell",
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
Copy link
Member

Choose a reason for hiding this comment

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

What does this mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this means run the inline commands using sudo. packer creates a temp file containing all the inline commands and then executes it. Since, we are running user's deployment script, it is better to use sudo, otherwise script might fail.

"inline": [
"rm -rf /deployTemp",
"mkdir /deployTemp",
"chmod 777 /deployTemp"
Copy link
Member

Choose a reason for hiding this comment

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

Why are we setting mod here? Will it continue to apply after copying more files into this folder below. Otherwise should we do it before script execution. And why 777 and not +x or 700

Copy link
Contributor Author

Choose a reason for hiding this comment

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

setting mod here since the next step which is file upload will need this. Packer does not provide a way to tell file upload to be done with sudo(unlike shell provisioner). I had tried with 700, but did not work.

@@ -0,0 +1,76 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

Any UTs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am adding UTs in parallel. Will update the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated UTs. please check.

@bishal-pdMSFT bishal-pdMSFT merged commit c1ebf71 into master Mar 10, 2017
@bryanmacfarlane bryanmacfarlane deleted the users/biprasad/packerBuild3 branch January 31, 2018 00:29
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