4 Star 6 Fork 2

Gitee 极速下载/Athens

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/gomods/athens
克隆/下载
init.ps1 2.14 KB
一键复制 编辑 原始数据 按行查看 历史
[CmdletBinding()]
Param(
[Parameter(Mandatory=$false)]
[switch]$build,
[Parameter(Mandatory=$false)]
[switch]$run,
[Parameter(Mandatory=$false)]
[switch]$docs,
[Parameter(Mandatory=$false)]
[Alias("setup-dev-env")]
[switch]$setup_dev_env,
[Parameter(Mandatory=$false)]
[switch]$verify,
[Parameter(Mandatory=$false)]
[switch]$test,
[Parameter(Mandatory=$false)]
[Alias("test-unit")]
[switch]$test_unit,
[Parameter(Mandatory=$false)]
[Alias("test-e2e")]
[switch]$test_e2e,
[Parameter(Mandatory=$false)]
[switch]$docker,
[Parameter(Mandatory=$false)]
[Alias("proxy-docker")]
[switch]$proxy_docker,
[Parameter(Mandatory=$false)]
[switch]$bench,
[Parameter(Mandatory=$false)]
[switch]$alldeps,
[Parameter(Mandatory=$false)]
[switch]$dev,
[Parameter(Mandatory=$false)]
[switch]$down
)
function execScript($name) {
$scriptsDir = "$(Join-Path scripts ps)"
& "$(Join-Path $scriptsDir $name)"
}
if ($setup_dev_env.IsPresent) {
& docker-compose -p athensdev up -d mongo
}
if ($build.IsPresent) {
try {
Push-Location $(Join-Path cmd proxy)
& go build
}
finally {
Pop-Location
}
finally {
Pop-Location
}
}
if ($run.IsPresent) {
Set-Location $(Join-Path cmd proxy)
}
if ($docs.IsPresent) {
Set-Location docs
& hugo
}
if ($verify.IsPresent) {
execScript "check_deps.ps1"
}
if ($alldeps.IsPresent) {
& docker-compose -p athensdev up -d mongo
& docker-compose -p athensdev up -d minio
& docker-compose -p athensdev up -d jaeger
Write-Host "sleeping for a bit to wait for the DB to come up"
Start-Sleep 5
}
if ($dev.IsPresent) {
& docker-compose -p athensdev up -d mongo
}
if ($test.IsPresent) {
try {
Push-Location $(Join-Path cmd proxy)
}
finally {
Pop-Location
}
finally {
Pop-Location
}
}
if ($test_unit.IsPresent) {
execScript "test_unit.ps1"
}
if ($test_e2e.IsPresent) {
execScript "test_e2e.ps1"
}
if ($docker.IsPresent) {
& docker build -t gomods/athens -f cmd/proxy/Dockerfile .
}
if ($proxy_docker.IsPresent) {
& docker build -t gomods/athens -f cmd/proxy/Dockerfile .
}
if ($bench.IsPresent) {
execScript "benchmark.ps1"
}
if ($down.IsPresent) {
& docker-compose -p athensdev down -v
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/mirrors/Athens.git
git@gitee.com:mirrors/Athens.git
mirrors
Athens
Athens
main

搜索帮助