Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
bonzofenix committed Aug 29, 2024
1 parent 97ebe68 commit 02a9e32
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ci/autoscaler/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ jobs:
- in_parallel:
- get: bbl-state
- get: app-autoscaler-release
passed: [unit-tests, integration-tests]
# passed: [unit-tests, integration-tests]
trigger: true
- get: ci
- task: make-prerelease
Expand Down
1 change: 1 addition & 0 deletions src/autoscaler/.cfignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
8 changes: 1 addition & 7 deletions src/autoscaler/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,6 @@ go-mod-vendor: ${go-vendoring-folder} ${go-vendored-files}
${go-vendoring-folder} ${go-vendored-files} &: ${app-fakes-dir} ${app-fakes-files}
go mod vendor

cf-build-%: generate-fakes
@echo "# building for cf $*"
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/$* $*/cmd/$*/main.go

cf-build: $(addprefix cf-build-,$(binaries))

# CGO_ENABLED := 1 is required to enforce dynamic linking which is a requirement of dynatrace.
build-%: ${openapi-generated-clients-and-servers-dir} ${openapi-generated-clients-and-servers-files}
@echo "# building $*"
Expand Down Expand Up @@ -167,7 +161,7 @@ mta-logs:
vim mta-*

.PHONY: mta-build
mta-build: mta-build-clean cf-build
mta-build: mta-build-clean
mbt build

mta-build-clean:
Expand Down
54 changes: 54 additions & 0 deletions src/autoscaler/Makefile_20240829141453.mta
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Generated with Cloud MTA Build Tool version 1.2.26
version=0.0.1
MBT=/Users/C5331208/workspace/app-autoscaler-release/.devbox/nix/profile/default/bin/mbt
ifndef p
$(error platform flag is expected. e.g. use make -f makefile.mta p=cf)
endif
target_provided=true
ifndef t
t="$(CURDIR)"
target_provided=false
endif
ifndef strict
strict=true
endif
ifndef mtar
mtar="*"
endif
modules := $(shell $(MBT) provide modules -d=dev)
modules := $(subst ],,$(subst [,,$(modules)))
# List of all the recipes to be executed during the build process
.PHONY: all pre_validate pre_build validate $(modules) post_build meta mtar cleanup
# Default target compile all
all: pre_validate pre_build validate $(modules) post_build meta mtar cleanup
# Validate mta.yaml
pre_validate:
@$(MBT) validate -r=${strict} -x="paths"
pre_build: pre_validate
@$(MBT) project build -p=pre


# Execute module build
define build_rule
$(1): validate
@$(MBT) module build -m=$(1) -p=${p} -t=${t}
endef

$(foreach mod,$(modules),$(eval $(call build_rule,$(mod))))# Create META-INF folder with MANIFEST.MF & mtad.yaml
meta: $(modules) post_build
@$(MBT) gen meta -p=${p} -t=${t}

post_build: $(modules)
@$(MBT) project build -p=post -t=${t}

# Validate mta.yaml
validate: pre_build
@$(MBT) validate -r=${strict}

# Pack as MTAR artifact
mtar: $(modules) meta
@$(MBT) gen mtar --mtar=${mtar} --target_provided=${target_provided} -t=${t}

cleanup: mtar
# Remove tmp folder
@$(MBT) clean -t=${t}
11 changes: 8 additions & 3 deletions src/autoscaler/mta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ version: 0.0.1

modules:
- name: metricsforwarder
type: binary
path: build
type: go
path: .
properties:
GO_INSTALL_PACKAGE_SPEC: code.cloudfoundry.org/app-autoscaler/src/autoscaler/metricsforwarder/cmd/metricsforwarder
requires:
- name: config
- name: policydb
Expand All @@ -18,8 +20,11 @@ modules:
disk-quota: 1G
instances: 2
stack: cflinuxfs4
command: ./metricsforwarder
routes:
build-parameters:
builder: custom
commands:
- make vendor

resources:
- name: config
Expand Down

0 comments on commit 02a9e32

Please sign in to comment.