-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
150 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
prepare_win() { | ||
local os | ||
os="$(uname)" | ||
if [[ $os = MINGW* ]]; then | ||
choco install mingw -y | ||
choco install python --version=3.11.0 -y | ||
fi | ||
} |
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,52 @@ | ||
$ErrorActionPreference = "Stop" # set -e | ||
|
||
# Forcing to checkout again all the files with a correct autocrlf. | ||
# Doing this here because we cannot set git clone options before. | ||
function fixCRLF() { | ||
Write-Host "-- Fixing CRLF in git checkout --" | ||
git config core.autocrlf true | ||
git rm --quiet --cached -r . | ||
git reset --quiet --hard | ||
} | ||
|
||
function withGolang() { | ||
# Write-Host "-- Install golang $env:GOLANG_VERSION --" | ||
# choco install golang -y --version $env:GOLANG_VERSION | ||
|
||
Write-Host "-- Install golang 1.20.7 --" | ||
choco install golang -y --version 1.20.7 | ||
|
||
$choco = Convert-Path "$((Get-Command choco).Path)\..\.." | ||
Import-Module "$choco\helpers\chocolateyProfile.psm1" | ||
refreshenv | ||
go version | ||
go env | ||
} | ||
|
||
function installGoDependencies() { | ||
$installPackages = @( | ||
"github.com/magefile/mage" | ||
"github.com/elastic/go-licenser" | ||
"golang.org/x/tools/cmd/goimports" | ||
"github.com/jstemmer/go-junit-report" | ||
"github.com/tebeka/go2xunit" | ||
) | ||
foreach ($pkg in $installPackages) { | ||
go install "$pkg" | ||
} | ||
} | ||
|
||
fixCRLF | ||
withGolang | ||
installGoDependencies | ||
|
||
$ErrorActionPreference = "Continue" # set +e | ||
|
||
#New-Item -ItemType Directory -Force -Path "build" | ||
Set-Location filebeat | ||
mage build unitTest | ||
|
||
$EXITCODE=$LASTEXITCODE | ||
$ErrorActionPreference = "Stop" | ||
|
||
Exit $EXITCODE |
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,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
source .buildkite/filebeat/scripts/pre-common.sh | ||
|
||
if [[ "$BUILDKITE_PIPELINE_SLUG" == "filebeat" ]]; then | ||
export WORKSPACE="$(pwd)" | ||
|
||
uname | ||
prepare_win | ||
|
||
if [[ -z "${GOLANG_VERSION-""}" ]]; then | ||
export GOLANG_VERSION=$(cat "${WORKSPACE}/.go-version") | ||
fi | ||
fi |
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