Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build): move packaging to shell script #434

Open
cofin opened this issue May 9, 2024 · 0 comments
Open

chore(build): move packaging to shell script #434

cofin opened this issue May 9, 2024 · 0 comments

Comments

@cofin
Copy link
Collaborator

cofin commented May 9, 2024

build-collector: ## Build the collector SQL scripts.
@rm -rf ./$(BUILD_DIR)/collector
@echo "=> Building Assessment Data Collection Scripts for Oracle version $(VERSION)..."
@mkdir -p $(BUILD_DIR)/collector/oracle/sql/extracts
@mkdir -p $(BUILD_DIR)/collector/oracle/sql/extracts/awr
@mkdir -p $(BUILD_DIR)/collector/oracle/sql/setup
@mkdir -p $(BUILD_DIR)/collector/oracle/sql/extracts/statspack
@cp scripts/collector/oracle/sql/*.sql $(BUILD_DIR)/collector/oracle/sql
@cp scripts/collector/oracle/sql/extracts/*.sql $(BUILD_DIR)/collector/oracle/sql/extracts
@cp scripts/collector/oracle/sql/extracts/awr/*.sql $(BUILD_DIR)/collector/oracle/sql/extracts/awr
@cp scripts/collector/oracle/sql/setup/*.sql $(BUILD_DIR)/collector/oracle/sql/setup
@cp scripts/collector/oracle/sql/extracts/statspack/*.sql $(BUILD_DIR)/collector/oracle/sql/extracts/statspack
@cp scripts/collector/oracle/collect-data.sh $(BUILD_DIR)/collector/oracle/
@cp scripts/collector/oracle/README.txt $(BUILD_DIR)/collector/oracle/
@cp LICENSE.txt $(BUILD_DIR)/collector/oracle
echo "Database Migration Assessment Collector version $(VERSION) ($(COMMIT_SHA))" > $(BUILD_DIR)/collector/oracle/VERSION.txt
@echo "=> Building Assessment Data Collection Scripts for Microsoft SQL Server version $(VERSION)..."
@mkdir -p $(BUILD_DIR)/collector/sqlserver/sql/
@cp scripts/collector/sqlserver/sql/*.sql $(BUILD_DIR)/collector/sqlserver/sql
@cp scripts/collector/sqlserver/*.bat $(BUILD_DIR)/collector/sqlserver/
@cp scripts/collector/sqlserver/*.ps1 $(BUILD_DIR)/collector/sqlserver/
@cp scripts/collector/sqlserver/*.psm1 $(BUILD_DIR)/collector/sqlserver/
@cp scripts/collector/sqlserver/README.txt $(BUILD_DIR)/collector/sqlserver/
@cp LICENSE.txt $(BUILD_DIR)/collector/sqlserver
@echo "Database Migration Assessment Collector version $(VERSION) ($(COMMIT_SHA))" > $(BUILD_DIR)/collector/sqlserver/VERSION.txt
@echo "=> Building Assessment Data Collection Scripts for MySQL version $(VERSION)..."
@mkdir -p $(BUILD_DIR)/collector/mysql/sql/
@mkdir -p $(BUILD_DIR)/collector/mysql/sql/5.7
@mkdir -p $(BUILD_DIR)/collector/mysql/sql/base
@cp scripts/collector/mysql/sql/*.sql $(BUILD_DIR)/collector/mysql/sql
@cp scripts/collector/mysql/sql/5.7/*.sql $(BUILD_DIR)/collector/mysql/sql/5.7
@cp scripts/collector/mysql/sql/base/*.sql $(BUILD_DIR)/collector/mysql/sql/base
@cp scripts/collector/mysql/collect-data.sh $(BUILD_DIR)/collector/mysql/
@cp -L scripts/collector/mysql/db-machine-specs.sh $(BUILD_DIR)/collector/mysql/
@cp scripts/collector/mysql/README.txt $(BUILD_DIR)/collector/mysql/
@cp LICENSE.txt $(BUILD_DIR)/collector/mysql
@echo "Database Migration Assessment Collector version $(VERSION) ($(COMMIT_SHA))" > $(BUILD_DIR)/collector/mysql/VERSION.txt
@echo "=> Building Assessment Data Collection Scripts for Postgresql version $(VERSION)..."
@mkdir -p $(BUILD_DIR)/collector/postgres/sql/
@mkdir -p $(BUILD_DIR)/collector/postgres/sql/12
@mkdir -p $(BUILD_DIR)/collector/postgres/sql/13
@mkdir -p $(BUILD_DIR)/collector/postgres/sql/base
@cp scripts/collector/postgres/sql/*.sql $(BUILD_DIR)/collector/postgres/sql
@cp scripts/collector/postgres/sql/12/*.sql $(BUILD_DIR)/collector/postgres/sql/12
@cp scripts/collector/postgres/sql/13/*.sql $(BUILD_DIR)/collector/postgres/sql/13
@cp scripts/collector/postgres/sql/base/*.sql $(BUILD_DIR)/collector/postgres/sql/base
@cp scripts/collector/postgres/collect-data.sh $(BUILD_DIR)/collector/postgres/
@cp scripts/collector/postgres/db-machine-specs.sh $(BUILD_DIR)/collector/postgres/
@cp scripts/collector/postgres/README.txt $(BUILD_DIR)/collector/postgres/
@cp LICENSE.txt $(BUILD_DIR)/collector/postgres
@echo "Database Migration Assessment Collector version $(VERSION) ($(COMMIT_SHA))" > $(BUILD_DIR)/collector/postgres/VERSION.txt
@make package-collector
.PHONY: package-collector
package-collector:
@rm -f ./$(BUILD_DIR)/$(COLLECTOR_PACKAGE)*.bz2
@rm -f ./$(BUILD_DIR)/$(COLLECTOR_PACKAGE)*.zip
@echo "=> Packaging Database Migration Assessment Collector for Oracle..."
@echo "Zipping files in ./$(BUILD_DIR)/collector/oracle"
@cd $(BASE_DIR)/$(BUILD_DIR)/collector/oracle; zip -r $(BASE_DIR)/$(BUILD_DIR)/$(COLLECTOR_PACKAGE)-oracle.zip *
@echo "=> Packaging Database Migration Assessment Collector for Microsoft SQL Server..."
@echo "Zipping files in ./$(BUILD_DIR)/collector/sqlserver"
@cd $(BASE_DIR)/$(BUILD_DIR)/collector/sqlserver; zip -r $(BASE_DIR)/$(BUILD_DIR)/$(COLLECTOR_PACKAGE)-sqlserver.zip *
@echo "=> Packaging Database Migration Assessment Collector for MySQL..."
@echo "Zipping files in ./$(BUILD_DIR)/collector/mysql"
@cd $(BASE_DIR)/$(BUILD_DIR)/collector/mysql; zip -r $(BASE_DIR)/$(BUILD_DIR)/$(COLLECTOR_PACKAGE)-mysql.zip *
@echo "=> Packaging Database Migration Assessment Collector for Postgres..."
@echo "Zipping files in ./$(BUILD_DIR)/collector/postgres"
@cd $(BASE_DIR)/$(BUILD_DIR)/collector/postgres; zip -r $(BASE_DIR)/$(BUILD_DIR)/$(COLLECTOR_PACKAGE)-postgres.zip *

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant