Skip to content

Commit

Permalink
feat(devbox): Add Cloud MTA Build Tool to devbox
Browse files Browse the repository at this point in the history
# Issue

For building MTAs the Cloud MTA Build Tool is required.

# Fix

Add it via local flake
  • Loading branch information
silvestre committed Jun 3, 2024
1 parent bb57f41 commit 01fb85d
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 44 deletions.
79 changes: 40 additions & 39 deletions devbox.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,44 @@
{
"packages": [
"path:local-flake#bosh-bootloader",
"path:local-flake#app-autoscaler-cli-plugin",
"path:local-flake#log-cache-cli-plugin",
"path:local-flake#uaac",
"delve@latest",
"gh@latest",
"go-tools@latest",
"gopls@latest",
"nodejs@latest",
"nodePackages.yaml-language-server@latest",
"rubocop@latest",
"rubyPackages.solargraph@latest",
"swagger-cli@latest",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"pre-commit@latest",
"[email protected]",
"[email protected]",
"[email protected]",
"which@latest",
"jq@latest",
"[email protected]",
"python@latest",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"bundix@latest",
"oha@latest",
"[email protected]",
"[email protected]",
"act@latest",
"google-cloud-sdk@latest",
"[email protected]",
"temurin-bin-17@latest"
],
"packages": {
"path:local-flake#bosh-bootloader": "",
"path:local-flake#app-autoscaler-cli-plugin": "",
"path:local-flake#log-cache-cli-plugin": "",
"path:local-flake#cloud-mta-build-tool": "",
"path:local-flake#uaac": "",
"credhub-cli": "2.9.29",
"delve": "latest",
"gh": "latest",
"go-tools": "latest",
"gopls": "latest",
"nodejs": "latest",
"nodePackages.yaml-language-server": "latest",
"rubocop": "latest",
"rubyPackages.solargraph": "latest",
"swagger-cli": "latest",
"actionlint": "1.6.27",
"direnv": "2.34.0",
"gnumake": "4.4",
"maven": "3.8.6",
"pre-commit": "latest",
"bosh-cli": "7.3.1",
"golangci-lint": "1.57.2",
"yq-go": "4.43.1",
"which": "latest",
"jq": "latest",
"fly": "7.10.0",
"python": "latest",
"cloudfoundry-cli": "8.7.10",
"shellcheck": "0.10.0",
"go": "1.21.5",
"ruby": "3.3.1",
"ginkgo": "2.19.0",
"bundix": "latest",
"oha": "latest",
"gum": "0.13.0",
"act": "latest",
"google-cloud-sdk": "latest",
"temurin-bin-17": "latest"
},
"shell": {
"init_hook": [
"cf install-plugin -f $(which app-autoscaler-cli-plugin)",
Expand Down
24 changes: 24 additions & 0 deletions local-flake/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,30 @@
ldflags = ["-s" "-w" "-X main.version=${version}"];
};

cloud-mta-build-tool = nixpkgsFor.${system}.buildGoModule rec {
pname = "Cloud MTA Build Tool";
version = "1.2.26";

src = nixpkgsFor.${system}.fetchFromGitHub {
owner = "SAP";
repo = "cloud-mta-build-tool";
rev = "v${version}";
hash = "sha256-DKZ9Nj/sNC9dRjyiu4MKjLrIJWluYlZzUHWqEqtrNt4=";
};

vendorHash = "sha256-h8LPsuxvbr/aRhH1vR1fYgBot37yrfiemZTJMKj0zbk=";

ldflags = ["-s" "-w" "-X main.Version=${version}"];

doCheck = false;

postInstall = ''
pushd "$out/bin" &> /dev/null
ln -s 'cloud-mta-build-tool' 'mbt'
popd
'';
};

uaac = nixpkgsFor.${system}.bundlerApp rec {
pname = "cf-uaac";
gemdir = ./.;
Expand Down
6 changes: 1 addition & 5 deletions scripts/asdf2devbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
def get_installed_version(package):
with open(os.path.join(script_dir, '..', 'devbox.json'), 'r') as f:
data = json.load(f)
for pkg in data['packages']:
if pkg.startswith(f"{package}@"):
return pkg.split('@')[1]
return None
return data['packages'][package]

# Read the .tool-versions file and process each line
if __name__ == "__main__":
Expand All @@ -27,7 +24,6 @@ def get_installed_version(package):
"bosh": "bosh-cli",
"cf": "cloudfoundry-cli",
"concourse": "fly",
"concourse": "fly",
"credhub": "credhub-cli",
"gcloud": "google-cloud-sdk",
"golang": "go",
Expand Down

0 comments on commit 01fb85d

Please sign in to comment.