@@ -49,8 +49,8 @@ function Validate-GitProvider {
4949 $git_provider_val = $git_provider_val.ToUpper ()
5050
5151 # Check if the converted value is either "GITLAB" or "GITHUB" or "BITBUCKET"
52- if ($git_provider_val -ne " GITLAB" -and $git_provider_val -ne " GITHUB" -and $git_provider_val -ne " BITBUCKET" ) {
53- Write-Host " Invalid git provider value. Please enter either GITLAB or GITHUB or BITBUCKET."
52+ if ($git_provider_val -ne " GITLAB" -and $git_provider_val -ne " GITHUB" -and $git_provider_val -ne " BITBUCKET" and $git_provider_val -ne " BITBUCKET-ENTERPRISE " ) {
53+ Write-Host " Invalid git provider value. Please enter either GITLAB or GITHUB or BITBUCKET or BITBUCKET-ENTERPRISE ."
5454 exit 1
5555 }
5656
@@ -698,13 +698,17 @@ $docker_enc_params=
698698
699699if ($mode -eq " server" ) {
700700 if (-not ([string ]::IsNullOrEmpty($props [$param_bito_access_key ])) -and -not ([string ]::IsNullOrEmpty($props [$param_git_access_token ]))) {
701- $git_secret = " $ ( $props [$param_bito_access_key ]) @#~^$ ( $props [$param_git_access_token ]) "
701+ if ($props [$param_git_provider ] -eq " BITBUCKET" -or $props [$param_git_provider ] -eq " BITBUCKET-ENTERPRISE" ) {
702+ $git_secret = $props [$param_git_access_token ]
703+ } else {
704+ $git_secret = " $ ( $props [$param_bito_access_key ]) @#~^$ ( $props [$param_git_access_token ]) "
705+ }
702706 $encryption_key = [System.Convert ]::ToBase64String((1 .. 32 | ForEach-Object { [byte ](Get-Random - Minimum 0 - Maximum 256 ) }))
703707 $git_secret_encrypted = Encrypt- GitSecret - key $encryption_key - plaintext $git_secret
704708 $docker_enc_params = " --git.secret=$git_secret_encrypted --encryption_key=$encryption_key "
705709 $docker_cmd += " ${docker_enc_params} "
706710
707- Write-Host " Use below as Gitlab and Github Webhook secret:"
711+ Write-Host " Use below as Gitlab and Github or Bitbucket Webhook secret:"
708712 Write-Host $git_secret_encrypted
709713 Write-Host
710714 }
0 commit comments