Skip to content

Commit a8689b7

Browse files
committed
Improve installation instructions
- Clone latest release. - Improve the Local copy instructions. - Remove the clone specific point in history instructions. - When security is a concern it's best to use a local copy since it's possible to produce a git hash collision.
1 parent 0ca2852 commit a8689b7

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

README.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,37 @@ Bash script for continuous integration of [Arduino](http://www.arduino.cc/) proj
66
[![Build Status](https://travis-ci.org/per1234/arduino-ci-script.svg?branch=master)](https://travis-ci.org/per1234/arduino-ci-script)
77

88
#### Installation
9-
- You can download a .zip of all the files from https://github.com/per1234/arduino-ci-script/archive/master.zip
10-
- Include the script in your project by adding the following line:
11-
```bash
9+
The script can be used in a variety of ways:
10+
11+
##### Clone the latest release
12+
Include the latest release of the script in your project by adding the following lines to your build configuration file:
13+
```yaml
14+
# Clone the script repository
15+
- git clone https://github.com/per1234/arduino-ci-script.git "${HOME}/scripts"
16+
- cd "${HOME}/scripts"
17+
# Get new tags from the remote
18+
- git fetch --tags
19+
# Checkout the latest tag
20+
- git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
21+
- source "${HOME}/scripts/arduino-ci-script.sh"
22+
```
23+
24+
##### Local copy
25+
If you're passing a token to the script's publish report functions then best security practices would be to use a static copy of the script so you can be sure of the commands the token is used with:
26+
- Download the latest version of the script from https://github.com/per1234/arduino-ci-script/releases by clicking one of the **Source code** links.
27+
- Unzip the downloaded file.
28+
- Copy arduino-ci-script.sh to a convenient location.
29+
- Include the script in your project by adding the following line to your build configuration file:
30+
```yaml
1231
- source arduino-ci-script.sh
1332
```
14-
- It's possible to leave the script hosted at this repository.
15-
```bash
33+
34+
##### Remote source
35+
It's possible to leave the script hosted at this repository:
36+
```yaml
37+
# Use the tip of the master branch of arduino-ci-script
1638
- source <(curl -SLs https://raw.githubusercontent.com/per1234/arduino-ci-script/master/arduino-ci-script.sh)
1739
```
18-
- The above doesn't allow you control over the version and would not be a good idea for security reasons if you use the functions that take a GitHub token argument. You could use the script at a specific point in the commit history with something like this:
19-
```bash
20-
- git clone https://github.com/per1234/arduino-ci-script.git "${HOME}/arduino-ci-script"
21-
- cd "${HOME}/arduino-ci-script"
22-
- git checkout 0355314d45970cd33e52ebba9967646a063ea9eb
23-
- source "${HOME}/arduino-ci-script/arduino-ci-script.sh"
24-
```
2540
2641
2742
#### Usage

0 commit comments

Comments
 (0)