Skip to content
This repository has been archived by the owner on Aug 23, 2021. It is now read-only.

Offer installation option for specific version #73

Closed
wants to merge 2 commits into from
Closed

Offer installation option for specific version #73

wants to merge 2 commits into from

Conversation

spawnia
Copy link
Contributor

@spawnia spawnia commented Apr 28, 2021

To improve upon the reproducibility of my setup, I figured out this way of installing a specific version and think it may be useful for others.

To improve upon the reproducibility of my setup, I figured out this way of installing a specific version and think it may be useful for others.
README.md Outdated
To install a specific version, execute the following:

```shell
export GIT_REF=v1.4.1
Copy link
Contributor

@akutz akutz Apr 28, 2021

Choose a reason for hiding this comment

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

Love this addition! One thing -- could we make it a little more flexible to support not just different versions from the primary repo, but from any fork as well? Such as this example from the Kubernetes image builder. It might look like this below:


To install a specific version, use the following environment variables to customize the source of the install script:

Name Description Default
GIT_USER The name of a GitHub user or organization. vmware
GIT_REPO The name of the GitHub repository. cloud-init-vmware-guestinfo
GIT_SLUG A / delimited combination of a GitHub user/organization and repository, prefixed with the GitHub raw content URL. https://raw.githubusercontent.com/${GIT_USER}/${GIT_REPO}
GIT_REF A git branch name, tag name, or commit ID. v1.4.1
GIT_URL The full path to the datasource installation script. ${GIT_SLUG}/${GIT_REF}/install.sh

The following command uses the above environment variables in such a way that if an environment variable is already set, its existing value will be used, otherwise the value will default to the value from the above table:

GIT_USER="${GIT_USER:-vmware}" \
GIT_REPO="${GIT_REPO:-cloud-init-vmware-guestinfo}" \
GIT_SLUG="${GIT_SLUG:-https://raw.githubusercontent.com/${GIT_USER}/${GIT_REPO}}" \
GIT_REF="${GIT_REF:-v.1.4.1}" \
GIT_URL="${GIT_URL:-${GIT_SLUG}/${GIT_REF}/install.sh}" \
curl -sSL "${GIT_URL}" | sh -

Copy link
Contributor

Choose a reason for hiding this comment

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

I am also fine accepting this as-is if you think the above overcomplicates things.

Copy link
Contributor

@akutz akutz Apr 28, 2021

Choose a reason for hiding this comment

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

One small nit though would be that you should not need to export the env var:

GIT_REF="v1.4.1" && \
curl -sSL "https://raw.githubusercontent.com/vmware/cloud-init-vmware-guestinfo/${GIT_REF}/install.sh" | sh -

The above will keep the shell free of an additional, exported env var; almost always a good thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A guide on how to install from a fork might be suitable for CONTRIBUTING.md. As of now, I think whoever decides to fork and install their own version should be deep enough into the weeds to figure out the installation.

@akutz
Copy link
Contributor

akutz commented Aug 11, 2021

This issue is being closed because this datasource has been merged into cloud-init (canonical/cloud-init#953):

Component Source Tests
Datasource DataSourceVMware.py test_vmware.py
Identification ds-identify test_ds_identify.py
Documentation vmware.rst

In order to participate in the growth of this datasource moving forward, please:

Once again, many thanks to the wonderful community that has grown around this datasource, and I look forward to seeing everyone in the new cloud-init forums!

@akutz akutz closed this Aug 11, 2021
@spawnia spawnia deleted the patch-1 branch August 12, 2021 07:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants