Skip to content

Latest commit

 

History

History
96 lines (73 loc) · 2.3 KB

File metadata and controls

96 lines (73 loc) · 2.3 KB

Woodpecker Windows Agent - Backend Local

  • Tested on Windows Server 2022 Core installation

Configuration

  1. Copy directory agent\backend-local to C:\ProgramData\woodpecker-local
  2. Edit global vars setup.cmd
WOODPECKER_AGENT_VERSION="v2.8.0"
WOODPECKER_SERVER="woodpecker.lan.xxxxx:39443"
WOODPECKER_HOSTNAME="woodpecker-agentxxx"
WOODPECKER_AGENT_SECRET="xxxxx"
WOODPECKER_MAX_WORKFLOWS="2"
WOODPECKER_FILTER_LABELS=""

PLUGIN_GIT_VERSION="2.6.0"

Setup

  • Run installer
C:\ProgramData\woodpecker-local> .\setup.cmd
  • Add Woodpecker plugins executable to path
C:\ProgramData\woodpecker-local> set SETUP_PATH="C:\ProgramData\woodpecker-local"
C:\ProgramData\woodpecker-local> setx /M PATH "%SETUP_PATH%\bin;%PATH%"

Install & Configure git

  • Install Software Manager - Chocolatey
# install
PS C:\> Set-ExecutionPolicy Bypass -Scope Process -Force;
PS C:\> [System.Net.PS ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
PS C:\> iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

# remember parameters on upgrade
choco feature enable -n=useRememberedArgumentsForUpgrades
  • Install Git
C:\> choco install git -y --params "'/Symlinks /NoGuiHereIntegration'"
  • Git System User Authentification
C:\> mkdir c:\tmp
C:\> cd C:\tmp
C:\tmp> curl -fSSL -o pstools.zip https://download.sysinternals.com/files/PSTools.zip
C:\tmp> unzip pstools.zip -d pstools
C:\tmp> rm -f pstools.zip
C:\tmp> .\pstools\psexec -i -s cmd.exe

# open new cmd.exe in system user
C:\Windows\system32> whoami
nt authority\system
C:\Windows\system32> git clone <REPO_TEST_URL>

Pipeline Usage

---
labels:
  platform: windows/amd64
  backend: local

steps:

  # example use minio command: mc.exe to upload file # mc.exe must be in $PATH
  - name: s3-upload-mc
    image: bash.exe
    secrets: [ bucket_name, access_key, secret_key ]
    environment:
      - S3_ENDPOINT=http://xxxx:9000
    commands:
      # connect alias
      - mc.exe alias set myminio $$env:S3_ENDPOINT $$env:ACCESS_KEY $$env:SECRET_KEY
      # status
      - mc.exe admin info myminio
      # upload file
      - mc.exe cp README.md myminio/$$env:BUCKET_NAME/$$env:CI_REPO/mc/README
...