Skip to content

Commit 4ef77b1

Browse files
committed
Apply suggestions Mikey
1 parent a4e4039 commit 4ef77b1

File tree

2 files changed

+269
-100
lines changed

2 files changed

+269
-100
lines changed

docs/installing-nightly.md

Lines changed: 139 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,177 @@
11
# Installing the "Nightly" build of DSC CLI
22

3-
> **Note**: Nightly builds contain the latest development features but may have bugs or breaking
4-
> changes. Only install if you want to test unreleased functionality. If you encounter issues,
5-
> please [open an issue](https://github.com/PowerShell/DSC/issues/new).
3+
> [!NOTE]
4+
> Nightly builds contain the latest development features but may have bugs or breaking changes.
5+
> Only install if you want to test unreleased functionality. If you encounter issues, please
6+
> [open an issue](https://github.com/PowerShell/DSC/issues/new).
67
7-
## Via script
8+
## Using a script
89

9-
> **Note**: This script requires the [GitHub CLI](https://cli.github.com/) to have already been
10-
> installed.
10+
> [!NOTE]
11+
> This script requires the [GitHub CLI](https://cli.github.com/) to have already been installed.
1112
1213
### DSC CLI
1314

14-
This will install the latest nightly DSC CLI binary:
15+
This will install the latest nightly DSC CLI binary to the following location depending on your
16+
platform:
1517

1618
- **Windows**: `%LOCALAPPDATA%\dsc\dsc.exe`
1719
- **Linux/macOS**: `~/.dsc/bin/dsc`
1820

19-
1. (macOS/Linux) Run the following:
21+
1. Retrieve the appropriate script. You can use the PowerShell script for Windows and the Bash script for Linux and macOS.
2022

21-
```sh
22-
bash <(curl -Ls https://raw.githubusercontent.com/PowerShell/DSC/refs/heads/main/sharedScripts/install_cli_nightly.sh)
23-
```
23+
- Bash (Linux and macOS):
2424

25-
1. (Windows) Run the following in a PowerShell window:
25+
```sh
26+
curl -o https://raw.githubusercontent.com/PowerShell/DSC/refs/heads/main/sharedScripts/install_cli_nightly.sh
27+
```
2628

27-
```powershell
28-
iex "& { $(irm https://raw.githubusercontent.com/PowerShell/DSC/refs/heads/main/sharedScripts/install_cli_nightly.ps1) }"
29-
```
29+
- PowerShell (Windows):
3030

31-
1. Add the installation directory to your PATH environment variable to use `dsc` from any location.
31+
```powershell
32+
Invoke-WebRequest -Uri https://raw.githubusercontent.com/PowerShell/DSC/refs/heads/main/sharedScripts/install_cli_nightly.ps1 -OutFile install_cli_nightly.ps1
33+
```
34+
35+
1. Review the script before invoking it.
36+
1. Invoke the script to install `dsc`:
37+
38+
- Bash (Linux and macOS):
39+
40+
```sh
41+
./install_cli_nightly.sh
42+
```
43+
44+
- PowerShell (Windows):
45+
46+
```powershell
47+
./install_cli_nightly.ps1
48+
```
49+
50+
1. Add the installation directory to your `PATH` environment variable.
3251

3352
## Manual
3453

35-
We are not currently publishing "nightly" releases, but you can grab the latest bits by viewing
36-
the latest Action workflows for the `main` branch (or any other branch).
54+
We don't currently publish nightly releases, but you can get the latest builds by viewing the most
55+
recent Action workflows for the `main` branch.
3756
38-
The easiest way to get these artifacts is through the GitHub site. Follow
39-
[this link](https://github.com/PowerShell/DSC/actions/workflows/rust.yml?query=branch%3Amain+is%3Asuccess)
40-
to view the latest successful Action workflows for the `main` branch. Select it to show the related
41-
artifacts.
57+
The easiest way to get these artifacts is through the GitHub site. The following link directs you
58+
to the latest successful Action workflows for merges to the `main` branch:
4259
43-
On the details page, select the artifact for your platform:
60+
<https://github.com/PowerShell/DSC/actions?query=workflow%3ARust+is%3Asuccess+branch%3Amain+event%3Apush>
61+
62+
Select the first link in the list to show the related artifacts. At the bottom of the page,
63+
download the artifact by selecting the artifact for your platform:
4464
4565
- `windows-bin` for Windows
4666
- `linux-bin` for Linux
4767
- `macos-bin` for macOS
4868
49-
Extract the archive and place the `dsc` executable (or `dsc.exe` on Windows) in a directory in
50-
your PATH.
69+
Extract the archive using the following steps:
70+
71+
- The artifact will be downloaded as `<platform>-bin.zip`. You can invoke the following commands to
72+
extract the contents into a folder called `dsc` in the current directory:
73+
74+
- Bash (Linux, macOS)
75+
76+
```sh
77+
# Be sure to set this to the appropriate platform: 'linux' or 'macos'
78+
platform="linux"
79+
artifact="$platform-bin.zip"
80+
# requires `unzip`, install if needed to expand the zip file
81+
unzip $artifact
82+
# Expand the tar file
83+
tar -xvf bin.tar
84+
# Move the subfolder containing the binaries and manifests
85+
mv ./bin/debug dsc
86+
```
87+
88+
- PowerShell (Linux, macOS, Windows):
89+
90+
```powershell
91+
# Be sure to set this to the appropriate platform: 'linux', 'macos', or 'windows'
92+
$platform = 'linux'
93+
$artifact = "$platform-bin.zip"
94+
# Expand the zip file
95+
Expand-Archive -Path $artifact -DestinationPath .
96+
# Expand the tar file
97+
tar -xvf bin.tar
98+
# Move the subfolder containing the binaries and manifests
99+
Move-Item -Path ./bin/debug -Destination dsc
100+
```
101+
102+
- Optionally, you can clean up the downloaded archive and intermediary files and folders:
103+
104+
- Bash (Linux, macOS)
105+
106+
```sh
107+
rm -rf ./bin ./bin.tar ./linux-bin.zip
108+
```
109+
110+
- PowerShell (Linux, macOS, Windows)
111+
112+
```powershell
113+
Remove-Item -Path ./$artifact, ./bin.tar, ./bin -Recurse -Force
114+
```
115+
116+
- Finally, make sure to add the folder containing the extracted binaries and resource manifests to
117+
your `PATH` environmental variable
51118
52119
## Advanced script options
53120
54-
### DSC CLI
121+
### CLI installation options
122+
123+
- Install to a custom directory:
124+
125+
- Bash (Linux, macOS):
126+
127+
```bash
128+
install_cli_nightly.sh --install-path /usr/local/bin
129+
```
130+
131+
- PowerShell (Windows):
132+
133+
```powershell
134+
install_cli_nightly.ps1 -InstallPath C:\tools\dsc
135+
```
136+
137+
- Install from a forking repository:
138+
139+
- Bash (Linux, macOS):
140+
141+
```bash
142+
install_cli_nightly.sh --repo myusername/DSC
143+
```
144+
145+
- PowerShell (Windows):
146+
147+
```powershell
148+
install_cli_nightly.ps1 -Repo myusername/DSC"
149+
```
55150
56-
- macOS/Linux
151+
- Install from a branch other than `main`:
57152
58-
```sh
59-
# install to a custom directory
60-
bash <(curl -Ls https://raw.githubusercontent.com/PowerShell/DSC/refs/heads/main/sharedScripts/install_cli_nightly.sh) --install-path /usr/local/bin
153+
- Bash (Linux, macOS):
61154
62-
# install from a fork repo
63-
bash <(curl -Ls https://raw.githubusercontent.com/PowerShell/DSC/refs/heads/main/sharedScripts/install_cli_nightly.sh) --repo myusername/DSC
155+
```bash
156+
install_cli_nightly.sh --branch feature-branch
157+
```
64158
65-
# install from a custom branch
66-
bash <(curl -Ls https://raw.githubusercontent.com/PowerShell/DSC/refs/heads/main/sharedScripts/install_cli_nightly.sh) --branch feature-branch
159+
- PowerShell (Windows):
67160
68-
# install from a specific github action run
69-
bash <(curl -Ls https://raw.githubusercontent.com/PowerShell/DSC/refs/heads/main/sharedScripts/install_cli_nightly.sh) --run-id 6146657618
70-
```
161+
```powershell
162+
install_cli_nightly.ps1 -Branch feature-branch"
163+
```
71164
72-
- Windows
165+
- Install from a specific GitHub Action run:
73166
74-
```powershell
75-
# install to a custom directory
76-
iex "& { $(irm https://raw.githubusercontent.com/PowerShell/DSC/refs/heads/main/sharedScripts/install_cli_nightly.ps1) } -InstallPath C:\tools\dsc"
167+
- Bash (Linux, macOS):
77168
78-
# install from a fork repo
79-
iex "& { $(irm https://raw.githubusercontent.com/PowerShell/DSC/refs/heads/main/sharedScripts/install_cli_nightly.ps1) } -Repo myusername/DSC"
169+
```bash
170+
install_cli_nightly.sh --run-id 6146657618
171+
```
80172
81-
# install from a custom branch
82-
iex "& { $(irm https://raw.githubusercontent.com/PowerShell/DSC/refs/heads/main/sharedScripts/install_cli_nightly.ps1) } -Branch feature-branch"
173+
- PowerShell (Windows):
83174
84-
# install from a specific github action run
85-
iex "& { $(irm https://raw.githubusercontent.com/PowerShell/DSC/refs/heads/main/sharedScripts/install_cli_nightly.ps1) } -RunId 6146657618"
86-
```
175+
```powershell
176+
install_cli_nightly.ps1 -RunId 6146657618"
177+
```

0 commit comments

Comments
 (0)