-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from kurokobo/deploy_main
feat: allow running tests against main branch
- Loading branch information
Showing
7 changed files
with
66 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
services: | ||
api: | ||
image: langgenius/dify-api:main | ||
|
||
worker: | ||
image: langgenius/dify-api:main | ||
|
||
web: | ||
image: langgenius/dify-web:main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,31 +5,43 @@ function Start-DifyInstance { | |
[String] $Path, | ||
|
||
[String] $Version, | ||
[String] $EnvFile, | ||
[String] $OverrideFile | ||
[String] $EnvFile | ||
) | ||
|
||
if ($env:PSDIFY_TEST_MODE -eq "cloud") { | ||
return | ||
} | ||
|
||
# check if the instance is already running | ||
try { | ||
$CurrentDifyVersion = (Get-DifyVersion -Server "http://host.docker.internal/").Version | ||
$IsRunning = (Get-DifyVersion -Server "http://host.docker.internal/").Version | ||
} | ||
catch { | ||
$CurrentDifyVersion = "" | ||
$IsRunning = $null | ||
} | ||
|
||
if ($CurrentDifyVersion -ne $Version) { | ||
Remove-DifyInstance -Path $Path | ||
New-DifyInstance -Path $Path -Version $Version -EnvFile $EnvFile -OverrideFile $OverrideFile | ||
|
||
$Server = "http://host.docker.internal/" | ||
$Email = "[email protected]" | ||
$Name = "Dify" | ||
$InitPassword = "difyai123456" | ConvertTo-SecureString -AsPlainText -Force | ||
$Password = "difyai123456" | ConvertTo-SecureString -AsPlainText -Force | ||
# gather the current version by reading the docker image label | ||
if ($IsRunning) { | ||
try { | ||
$CurrentVersion = (docker inspect docker-api-1 | ConvertFrom-Json).Config.Labels."org.opencontainers.image.version" | ||
} | ||
catch { | ||
$CurrentVersion = $null | ||
} | ||
} | ||
|
||
$null = Initialize-Dify -Server $Server -Email $Email -Name $Name -InitPassword $InitPassword -Password $Password | ||
if ($IsRunning -and ($CurrentVersion -eq $Version)) { | ||
return | ||
} | ||
|
||
Remove-DifyInstance -Path $Path | ||
New-DifyInstance -Path $Path -Version $Version -EnvFile $EnvFile | ||
|
||
$Server = "http://host.docker.internal/" | ||
$Email = "[email protected]" | ||
$Name = "Dify" | ||
$InitPassword = "difyai123456" | ConvertTo-SecureString -AsPlainText -Force | ||
$Password = "difyai123456" | ConvertTo-SecureString -AsPlainText -Force | ||
|
||
$null = Initialize-Dify -Server $Server -Email $Email -Name $Name -InitPassword $InitPassword -Password $Password | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters