Skip to content

Windows PowerShell installation script#146

Merged
lucaspin merged 62 commits intomasterfrom
windows-installation-script
Mar 10, 2022
Merged

Windows PowerShell installation script#146
lucaspin merged 62 commits intomasterfrom
windows-installation-script

Conversation

@lucaspin
Copy link
Copy Markdown
Contributor

@lucaspin lucaspin commented Mar 8, 2022

Relies on #144 and #145.

It doesn't seem like Windows has a go-to service manager like systemd around. It has nssm, but it seems like it isn't touched for quite a while. So I decided not to commit on a service manager for now.

This installation script installs the agent in the same directory where the script is, so it is supposed to be run like:

# Prepare the environment
New-Item -ItemType Directory -Path C:\semaphore-agent
Set-Location C:\semaphore-agent

# Download and unpack agent tar
Invoke-WebRequest https://github.com/semaphoreci/agent/releases/download/v2.0.18/agent_Windows_x86_64.tar.gz -OutFile agent.tar.gz
tar.exe -xf agent.tar.gz

# Set environment variables and install it
$env:SemaphoreOrganization = semaphore # or $env:SemaphoreEndpoint = "on-prem.yourdomain.com”
$env:SemaphoreRegistrationToken = myverysensitivetoken
.\install.ps1

That is similar to what we have for other operating systems.

Example output

PS C:\semaphore-agent> .\install.ps1
> Toolbox will be installed at C:\Users\vagrant\.toolbox.
> Toolbox already installed at C:\Users\vagrant\.toolbox. Overriding it...
> Downloading and unpacking toolbox...
> Installing toolbox...
Installing Checkout module in C:\Users\vagrant\Documents\WindowsPowerShell\Modules...
Checkout module directory already exists. Overriding it...
Creating Checkout module directory at C:\Users\vagrant\Documents\WindowsPowerShell\Modules\Checkout...
Copying .psm1 file to checkout module directory...
Installation completed successfully.
> Agent configuration file already exists in C:\semaphore-agent\config.yaml. Overriding it...
> Successfully installed the agent in C:\semaphore-agent.

  Start the agent with: C:\semaphore-agent\agent.exe start --config-file C:\semaphore-agent\config.yaml

@lucaspin lucaspin mentioned this pull request Mar 8, 2022
@lucaspin lucaspin requested a review from shiroyasha March 8, 2022 22:10
Comment thread install.ps1
Base automatically changed from windows-support to master March 10, 2022 11:30
@lucaspin lucaspin merged commit 8b49ac0 into master Mar 10, 2022
@lucaspin lucaspin deleted the windows-installation-script branch March 10, 2022 11:58
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.

2 participants