Skip to content

Commit 36ff60c

Browse files
committed
feat(devbox): Add Cloud MTA Build Tool to devbox
# Issue For building MTAs the Cloud MTA Build Tool is required. # Fix Add it via local flake
1 parent b44b05f commit 36ff60c

File tree

3 files changed

+92
-42
lines changed

3 files changed

+92
-42
lines changed

devbox.json

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,46 @@
11
{
2-
"packages": [
3-
"path:local-flake#bosh-bootloader",
4-
"path:local-flake#app-autoscaler-cli-plugin",
5-
"path:local-flake#log-cache-cli-plugin",
6-
"path:local-flake#uaac",
7-
"credhub-cli@latest",
8-
"delve@latest",
9-
"gh@latest",
10-
"go-tools@latest",
11-
"gopls@latest",
12-
"nodejs@latest",
13-
"nodePackages.yaml-language-server@latest",
14-
"rubocop@latest",
15-
"rubyPackages.solargraph@latest",
16-
"swagger-cli@latest",
17-
"actionlint@1.6.27",
18-
"direnv@2.34.0",
19-
"gnumake@4.4",
20-
"maven@3.8.6",
21-
"pre-commit@latest",
22-
"bosh-cli@7.5.6",
23-
"golangci-lint@1.57.2",
24-
"yq-go@4.43.1",
25-
"which@latest",
26-
"jq@latest",
27-
"fly@7.10.0",
28-
"python@latest",
29-
"cloudfoundry-cli@8.7.10",
30-
"shellcheck@0.10.0",
31-
"act@0.2.62",
32-
"go@1.21.5",
33-
"ruby@3.3.1",
34-
"ginkgo@2.17.3",
35-
"google-cloud-sdk@latest",
36-
"temurin-bin-17@latest",
37-
"bundix@latest",
38-
"oha@latest"
39-
],
2+
"packages": {
3+
"path:local-flake#bosh-bootloader": "",
4+
"path:local-flake#app-autoscaler-cli-plugin": "",
5+
"path:local-flake#log-cache-cli-plugin": "",
6+
"path:local-flake#mbt": "",
7+
"path:local-flake#sap-piper": {
8+
"platforms": ["x86_64-linux"]
9+
},
10+
"path:local-flake#uaac": "",
11+
"credhub-cli": "latest",
12+
"delve": "latest",
13+
"gh": "latest",
14+
"go-tools": "latest",
15+
"gopls": "latest",
16+
"nodejs": "latest",
17+
"nodePackages.yaml-language-server": "latest",
18+
"rubocop": "latest",
19+
"rubyPackages.solargraph": "latest",
20+
"swagger-cli": "latest",
21+
"actionlint": "1.6.27",
22+
"direnv": "2.34.0",
23+
"gnumake": "4.4",
24+
"maven": "3.8.6",
25+
"pre-commit": "latest",
26+
"bosh-cli": "7.5.6",
27+
"golangci-lint": "1.57.2",
28+
"yq-go": "4.43.1",
29+
"which": "latest",
30+
"jq": "latest",
31+
"fly": "7.10.0",
32+
"python": "latest",
33+
"cloudfoundry-cli": "8.7.10",
34+
"shellcheck": "0.10.0",
35+
"act": "0.2.62",
36+
"go": "1.21.5",
37+
"ruby": "3.3.1",
38+
"ginkgo": "2.17.3",
39+
"bundix": "latest",
40+
"oha": "latest",
41+
"google-cloud-sdk": "latest",
42+
"temurin-bin-17": "latest"
43+
},
4044
"shell": {
4145
"init_hook": [
4246
"cf install-plugin -f $(which app-autoscaler-cli-plugin)",

local-flake/flake.nix

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,54 @@
5858
ldflags = ["-s" "-w" "-X main.version=${version}"];
5959
};
6060

61+
mbt = nixpkgsFor.${system}.buildGoModule rec {
62+
pname = "Cloud MTA Build Tool";
63+
version = "1.2.26";
64+
65+
src = nixpkgsFor.${system}.fetchFromGitHub {
66+
owner = "SAP";
67+
repo = "cloud-mta-build-tool";
68+
rev = "v${version}";
69+
hash = "sha256-DKZ9Nj/sNC9dRjyiu4MKjLrIJWluYlZzUHWqEqtrNt4=";
70+
};
71+
72+
vendorHash = "sha256-h8LPsuxvbr/aRhH1vR1fYgBot37yrfiemZTJMKj0zbk=";
73+
74+
ldflags = ["-s" "-w" "-X main.Version=${version}"];
75+
76+
doCheck = false;
77+
78+
postInstall = ''
79+
pushd "$out/bin" &> /dev/null
80+
ln -s 'cloud-mta-build-tool' 'mbt'
81+
popd
82+
'';
83+
};
84+
85+
sap-piper = nixpkgsFor.${system}.buildGoModule rec {
86+
pname = "Project Piper";
87+
version = "1.360.0";
88+
89+
src = nixpkgsFor.${system}.fetchFromGitHub {
90+
owner = "SAP";
91+
repo = "jenkins-library";
92+
rev = "v${version}";
93+
hash = "sha256-eCg9fgP4pIhbW8zkg6izHb6V1VrkA+4hUCNvjMYOagI=";
94+
};
95+
96+
vendorHash = "sha256-qCoz6jGoqGYsTYumrdy4RA3LdVwaMhS+vcCK2n970eg=";
97+
98+
ldflags = ["-s" "-w" "-X github.com/SAP/jenkins-library/cmd.GitTag=v${version}"];
99+
100+
doCheck = false;
101+
102+
postInstall = ''
103+
pushd "$out/bin" &> /dev/null
104+
ln -s 'jenkins-library' 'piper'
105+
popd
106+
'';
107+
};
108+
61109
uaac = nixpkgsFor.${system}.bundlerApp rec {
62110
pname = "cf-uaac";
63111
gemdir = ./.;

scripts/asdf2devbox.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
def get_installed_version(package):
1212
with open(os.path.join(script_dir, '..', 'devbox.json'), 'r') as f:
1313
data = json.load(f)
14-
for pkg in data['packages']:
15-
if pkg.startswith(f"{package}@"):
16-
return pkg.split('@')[1]
17-
return None
14+
return data['packages'][package]
1815

1916
# Read the .tool-versions file and process each line
2017
if __name__ == "__main__":
@@ -27,6 +24,7 @@ def get_installed_version(package):
2724
"bosh": "bosh-cli",
2825
"cf": "cloudfoundry-cli",
2926
"concourse": "fly",
27+
"credhub": "credhub-cli",
3028
"gcloud": "google-cloud-sdk",
3129
"golang": "go",
3230
"java": "temurin-bin-17",

0 commit comments

Comments
 (0)