Skip to content

Commit

Permalink
Make steps run from inside the proper project folder
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandros Sapranidis <alexandros@elastic.co>
  • Loading branch information
alexsapran committed Mar 20, 2024
1 parent 48a7851 commit a090777
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 21 deletions.
17 changes: 13 additions & 4 deletions .buildkite/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __init__(
definition: dict[str, Any],
):
self.command = definition.get("command", "")
self.envs = definition.get("env", [])
self.env = definition.get("env", {})
self.agent: Agent = agent
self.name: str = name
self.project: str = project
Expand All @@ -85,10 +85,19 @@ def __init__(
def __lt__(self, other):
return self.name < other.name

def step_command(self) -> list[str]:
commands = [
# pushd works for windows as well
# https://en.wikipedia.org/wiki/Pushd_and_popd#:~:text=In%20Windows%20PowerShell%2C%20pushd%20is,the%20pushd%20and%20popd%20commands.
f"pushd {self.project}",
self.command,
]
return commands

def create_entity(self) -> dict[str, Any]:
data = {
"label": f"{self.project} {self.name}",
"command": [self.command],
"command": self.step_command(),
"notify": [
{
"github_commit_status": {
Expand All @@ -102,8 +111,8 @@ def create_entity(self) -> dict[str, Any]:
f"{self.project}/build/*.json",
],
}
if len(self.envs) > 0:
data["env"] = self.envs
if self.env:
data["env"] = self.env
return data


Expand Down
20 changes: 10 additions & 10 deletions auditbeat/buildkite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ stages:
mandatory:
# NOTE: stage name should be unique!
unitTest:
command: "mage -d auditbeat build unitTest"
command: "build unitTest"
platform: "family/platform-ingest-beats-ubuntu-2204"
crosscompile:
command: "make -C auditbeat crosscompile"
command: "make crosscompile"
platform: "family/platform-ingest-beats-ubuntu-2204"
env:
GOX_FLAGS: "-arch amd64"
unitTest-rhel-9:
command: "mage -d auditbeat build unitTest"
command: "mage build unitTest"
platform: "family/platform-ingest-beats-rhel-9"
unitTest-windows-2022:
command: "mage -d auditbeat build unitTest"
command: "mage build unitTest"
platform: "family/platform-ingest-beats-windows-2022"
unitTest-windows-2016:
command: "mage -d auditbeat build unitTest"
command: "mage build unitTest"
platform: "family/platform-ingest-beats-windows-2016"
# optional stage - it runs on:
# - branches/tags
Expand All @@ -36,21 +36,21 @@ stages:
extended:
# NOTE: stage name should be unique!
integTest:
command: "mage -d auditbeat build integTest"
command: "mage build integTest"
platform: "platform-ingest-beats-ubuntu-2204-aarch64"
provider: "aws"
integTest-arm:
command: "mage -d auditbeat build integTest"
command: "mage build integTest"
platform: "platform-ingest-beats-ubuntu-2204-aarch64"
provider: "aws"
unitTest-arm:
command: "mage -d auditbeat build unitTest"
command: "mage build unitTest"
platform: "platform-ingest-beats-ubuntu-2204-aarch64"
provider: "aws"
unitTest-macos:
command: "mage -d auditbeat build unitTest"
command: "mage build unitTest"
platform: "generic-13-ventura-x64"
provider: "orka"
unitTest-windows-2019:
command: "mage -d auditbeat build unitTest"
command: "mage build unitTest"
platform: "family/core-windows-2019"
14 changes: 7 additions & 7 deletions filebeat/buildkite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@ stages:
mandatory:
# NOTE: stage name should be unique!
unitTest:
command: "mage -d filebeat unitTest"
command: "mage unitTest"
platform: "family/platform-ingest-beats-ubuntu-2204"
crosscompile:
command: "make -C filebeat crosscompile"
command: "make crosscompile"
platform: "family/platform-ingest-beats-ubuntu-2204"
env:
GOX_FLAGS: "-arch amd64"
goIntegTest:
command: "mage -d filebeat goIntegTest"
command: "mage goIntegTest"
platform: "family/platform-ingest-beats-ubuntu-2204"
pythonIntegTest:
command: "mage -d filebeat pythonIntegTest"
command: "mage pythonIntegTest"
platform: "family/platform-ingest-beats-ubuntu-2204"
rhel-9:
command: "mage -d filebeat unitTest"
command: "mage unitTest"
platform: "family/platform-ingest-beats-rhel-9"
unitTest-windows-2022:
command: "mage -d filebeat build unitTest"
command: "mage build unitTest"
platform: "family/platform-ingest-beats-windows-2022"
unitTest-windows-2016:
command: "mage -d filebeat build unitTest"
command: "mage build unitTest"
platform: "family/platform-ingest-beats-windows-2016"
# optional stage - it runs on:
# - branches/tags
Expand Down

0 comments on commit a090777

Please sign in to comment.