Skip to content

Add template installation script and documentation #84

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

Merged
merged 10 commits into from
Jun 28, 2021
Merged

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Jun 27, 2021

This shell script provides the option to install the application with a single command.

It defaults to installing the latest release to ./bin/, but the user also has the option of specifying a version and installation path.


This is based on the installation script, instructions, and test workflow from Arduino Lint:

For this pull request, I have limited the changes to:

  • Making it pass CI
  • Replacing project-specific references to allow it to serve effectively as a template
  • Modifications to test workflow to allow it to work in this context

The functionality of the script and documentation should be unchanged.


A test workflow uses the script in various configurations to install Arduino Lint in order to verify the script is working correctly.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jun 27, 2021
@per1234
Copy link
Contributor Author

per1234 commented Jun 27, 2021

The failure of the "Check Workflows" CI run is caused by a newly introduced error in the GitHub Actions workflow JSON schema. That spurious validation failure will be resolved once SchemaStore/schemastore#1678 is merged (usually only a matter of a few days response time in that repo),

per1234 added 10 commits June 28, 2021 03:45
This is the standardized shell script formatting style to be used in all Arduino Tooling projects.
The installation script checks the path of the effective executable after installing the application. If it is different
from the installation path, it warns the user.

Previously, the external tool `which` was used for this purpose. This is a violation of ShellCheck rule C2230, which
results in an error with the version of ShellCheck installed in the GitHub Actions runner (0.7.0).

The installation script is intended to use POSIX standard tools where possible in order to be as portable as possible.
The recommended replacement `command -v` works equally as well for this particular application, so there is no reason not
to make the change recommended by ShellCheck.

Reference:
https://github.com/koalaman/shellcheck/wiki/SC2230
These are intended to facilitate syncing fixes and improvements to the templates in either direction.
This content has multiple issues:

- Contains project-specific references
- Outdated (doesn't mention BINDIR)

Since it needs to be modified one way or the other and we already have documentation of the script in installation.md, I
think it's best to remove this altogether to avoid the need to maintain two copies of the documentation, and the
likelihood that it will not be maintained.
The template installation script will be made non-project specific, to be configured for each project it is applied to.
However, for testing it is necessary to pick an arbitrary application to install.

Although the text replacement approach taken here is crude, it has the advantage of not requiring any modifications be
made to the script solely for the sake of allowing the test. Those modifications would make this important script more
fragile and difficult to maintain. It's better for that fragility and maintenance burden instead be borne by the test
workflow itself.
… script

Use of an obvious placeholder value will make it more clear where the template installation script's configuration must
be modified for the individual project it is applied to.

I left the PROJECT_OWNER configuration variable unchanged because it's likely that all repositories where the Tooling
Team uses this script will be under the arduino GitHub organization.
Variable names made reference to the specific project the script originated from. This would be confusing when it was
used in other projects.

This is a pure refactoring without any functional effect.
The installation instructions contained project-specific references from the document's origin. These are replaced with
placeholder text to make it serve as a template.
@per1234 per1234 merged commit f28800c into main Jun 28, 2021
@per1234 per1234 deleted the install-script branch June 28, 2021 10:54
@per1234 per1234 self-assigned this Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants