OSDeploy / OSD

OSD Shared Functions
MIT License
144 stars 59 forks source link

Adding Gitlab API Support #32

Closed CodyRWhite closed 1 year ago

CodyRWhite commented 2 years ago

Adding Gitlab API Support

This change adds support for accessing GitLab repositories with or without OAuth. This update does not alter the existing switches so that existing configurations will not need to be modified.

Existing switches that have verified and worked

Start-OSDPad OSDeploy OSDHelp OSDCloudDeploy [-OAuth xxxxxxxxxxx]
Start-OSDPad -RepoOwner OSDeploy -RepoName OSDHelp -RepoFolder OSDCloudDeploy [-OAuth xxxxxxxxxxx]

Screen Capture github example

New switches to support GitLab

Start-OSDPad 26 Scripts -RepoDomain gitlab.domain.com [-OAuth xxxxxxxxxxx]
Start-OSDPad -RepoName 26 -RepoFolder Scripts -RepoDomain gitlab.domain.com [-OAuth xxxxxxxxxxx]

Screen Capture gitlab example

CodyRWhite commented 2 years ago

Sorry had some issues rebasing. This should be good now.

CodyRWhite commented 2 years ago

To do a quick test you can run these commands inside of OSDCloud WinPE once it has booted.

These commands will prepare the environment, download the modified versions of the file, and force reload the module.

Set-DisRes 1600
Set-Location -Path "X:\Program Files\WindowsPowerShell\Modules\OSD\22.6.17.1\Public\Functions\split"
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/CodyRWhite/OSD/GitLab-API/Public/Functions/split/Start-OSDPad.ps1" -OutFile "Start-OSDPad.ps1"
Set-Location -Path "X:\Program Files\WindowsPowerShell\Modules\OSD\22.6.17.1\Projects"
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/CodyRWhite/OSD/GitLab-API/Projects/OSDPad.ps1" -OutFile "OSDPad.ps1"
Import-Modules OSD -Force

once the module has been reloaded you can test with the following commands

I can setup a test GitLab environment if required for PoC/Testing.