Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
bonzofenix committed Sep 5, 2024
1 parent a52240c commit 2b056f1
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 9 deletions.
23 changes: 15 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ clean-acceptance:
build: $(all_modules)
build-tests: build-test
build-test: $(addprefix test_,$(go_modules))
build-all: build build-test build-test-app ## Build all modules and tests
build-all: build build-test build-test-app mta-build ## Build all modules and tests
db: target/db
target/db:
@echo "# building $@"
Expand Down Expand Up @@ -260,13 +260,6 @@ build/autoscaler-test.tgz:
@mkdir -p build
@bosh create-release --force --timestamp-version --tarball=build/autoscaler-test.tgz

.PHONY: acceptance-release
acceptance-release: clean-acceptance go-mod-tidy go-mod-vendor build-test-app
@echo " - building acceptance test release '${VERSION}' to dir: '${DEST}' "
@mkdir -p ${DEST}
${AUTOSCALER_DIR}/scripts/compile-acceptance-tests.sh
@tar --create --auto-compress --directory="src" --file="${ACCEPTANCE_TESTS_FILE}" 'acceptance'

.PHONY: generate-fakes autoscaler.generate-fakes test-app.generate-fakes
generate-fakes: autoscaler.generate-fakes test-app.generate-fakes
autoscaler.generate-fakes:
Expand Down Expand Up @@ -360,7 +353,21 @@ deploy-prometheus: ${prometheus-bosh-release-path}/manifests
${CI_DIR}/infrastructure/scripts/deploy-prometheus.sh;


.PHONY: mta-release
mta-release: mta-build
@echo " - building mtar release '${VERSION}' to dir: '${DEST}' "

.PHONY: acceptance-release
acceptance-release: clean-acceptance go-mod-tidy go-mod-vendor build-test-app
@echo " - building acceptance test release '${VERSION}' to dir: '${DEST}' "
@mkdir -p ${DEST}
${AUTOSCALER_DIR}/scripts/compile-acceptance-tests.sh
@tar --create --auto-compress --directory="src" --file="${ACCEPTANCE_TESTS_FILE}" 'acceptance'

.PHONY: mta-build
mta-build:
@echo " - building mta"
@make --directory='./src/autoscaler' mta-build

.PHONY: build-test-app
build-test-app:
Expand Down
1 change: 1 addition & 0 deletions src/autoscaler/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build/
mta.yaml
fakes/
mta_archives/
7 changes: 7 additions & 0 deletions src/autoscaler/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ SHELL := /bin/bash
MAKEFLAGS := -s
aes_terminal_font_yellow := \e[38;2;255;255;0m
aes_terminal_reset := \e[0m
VERSION ?= 0.0.0-rc.1
DEST ?= build

GO_VERSION = $(shell go version | sed -e 's/^[^0-9.]*\([0-9.]*\).*/\1/')
GO_DEPENDENCIES = $(shell find . -type f -name '*.go')
Expand All @@ -29,6 +31,7 @@ GINKGO_OPTS = -r --race --require-suite --randomize-all --cover ${OPTS}
GINKGO_VERSION = v$(shell cat ../../.tool-versions | grep ginkgo | cut --delimiter=' ' --fields='2')



# ogen generated OpenAPI clients and servers
openapi-generated-clients-and-servers-dir := ./helpers/apis/scalinghistory
openapi-spec-path := ../../api
Expand Down Expand Up @@ -162,7 +165,11 @@ mta-logs:

.PHONY: mta-build
mta-build: mta-build-clean
cp mta.tpl.yaml mta.yaml
sed -i 's/VERSION/$(VERSION)/g' mta.yaml
mkdir -p $(DEST)
mbt build
mv mta_archives/com.github.cloudfoundry.app-autoscaler-release_$(VERSION).mtar $(DEST)/app-autoscaler-release-v$(VERSION).mtar

mta-build-clean:
rm -rf mta_archives
47 changes: 47 additions & 0 deletions src/autoscaler/mta.tpl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
ID: com.github.cloudfoundry.app-autoscaler-release
description: Application Autoscaler Release for Cloud Foundry
_schema-version: "3.3.0"
provider: Cloud Foundry Foundation
copyright: Apache License 2.0
version: VERSION

modules:
- name: metricsforwarder
type: go
path: .
properties:
GO_INSTALL_PACKAGE_SPEC: code.cloudfoundry.org/app-autoscaler/src/autoscaler/metricsforwarder/cmd/metricsforwarder
requires:
- name: config
- name: policydb
- name: syslog-client
parameters:
memory: 1G
disk-quota: 1G
instances: 2
stack: cflinuxfs4
routes:
build-parameters:
builder: custom
commands:
- make vendor

resources:
- name: config
type: org.cloudfoundry.user-provided-service
parameters:
service-tags:
- config
path: metricsforwarder/default_config.json
- name: policydb
type: org.cloudfoundry.user-provided-service
parameters:
service-tags:
- policy_db
- relational
- name: syslog-client
type: org.cloudfoundry.user-provided-service
parameters:
service-tags:
- syslog-client

2 changes: 1 addition & 1 deletion src/autoscaler/mta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Application Autoscaler Release for Cloud Foundry
_schema-version: "3.3.0"
provider: Cloud Foundry Foundation
copyright: Apache License 2.0
version: 0.0.1
version: 0.0.0-rc.1

modules:
- name: metricsforwarder
Expand Down

0 comments on commit 2b056f1

Please sign in to comment.