mirror of
https://github.com/gomods/athens
synced 2026-02-03 11:00:32 +00:00
* Set GO111MODULE to auto in golint script– #1743 As mentioned in #1743 the Go modules environment flag is set to `off` in the script which appears to cause a warning message for each module of the codebase that it is "not in GOROOT". Set to `auto` as this allows the same build to be run the original way should someone choose to delete the `go.mod` file from the project root. * Remove redundant code – golint script Go 1.17 ignores `GO111MODULE` and there are no directories in the project root called `mock`. * Replace `golint` with `go vet` `golint` is deprecated (and frozen) replace with the current `go vet`. This reported one issue on `main` branch: ```pkg/stash/with_etcd.go:33:28: loop variable ep captured by func literal``` Fixed loop variable capture with extraction to parameterised anonymous function passed loop variable and passed in to `errgroup.Go` call. * Finish Removing `golint` Removed remaining references to `golint` in dev doc, Makefile, bash scripts, and powershell build scripts. Removed `get_dev_tools.sh` and `get_dev_tools.ps1` as they only install the removed `golint` package.
136 lines
2.2 KiB
PowerShell
136 lines
2.2 KiB
PowerShell
[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_gofmt.ps1"
|
|
execScript "check_govet.ps1"
|
|
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
|
|
}
|