-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
32 lines (25 loc) · 1.66 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
include .env
# The name of the file to be modified
CONNECTOR_APPLICATION_PROPERTIES = ./connector/src/main/resources/application.properties
CONNECTOR_DATABASE_PROPERTIES = ./connector/src/main/resources/database.properties
CONNECTOR_LOG4J_PROPERTIES = ./connector/src/main/resources/log4j.properties
CONNECTOR_SETTINGS = ./connector/src/main/resources/settings.properties
.DEFAULT_GOAL = modify
.PHONY: clean copy modify
# Clean configuration
clean:
rm -rf $(CONNECTOR_APPLICATION_PROPERTIES) $(CONNECTOR_DATABASE_PROPERTIES) $(CONNECTOR_LOG4J_PROPERTIES) $(CONNECTOR_SETTINGS)
# Copy .dist
copy:
cp $(CONNECTOR_APPLICATION_PROPERTIES).dist $(CONNECTOR_APPLICATION_PROPERTIES)
cp $(CONNECTOR_DATABASE_PROPERTIES).dist $(CONNECTOR_DATABASE_PROPERTIES)
cp $(CONNECTOR_LOG4J_PROPERTIES).dist $(CONNECTOR_LOG4J_PROPERTIES)
cp $(CONNECTOR_SETTINGS).dist $(CONNECTOR_SETTINGS)
# Modify copies
modify: clean copy
sed -i "s/ohdbserver/$(OH_MARIADB_SERVER)/g" $(CONNECTOR_APPLICATION_PROPERTIES) $(CONNECTOR_DATABASE_PROPERTIES) $(CONNECTOR_LOG4J_PROPERTIES)
sed -i "s/ohdbport/$(OH_MARIADB_PORT)/g" $(CONNECTOR_APPLICATION_PROPERTIES) $(CONNECTOR_DATABASE_PROPERTIES) $(CONNECTOR_LOG4J_PROPERTIES)
sed -i "s/ohdbname/$(OH_MARIADB_DATABASE)/g" $(CONNECTOR_APPLICATION_PROPERTIES) $(CONNECTOR_DATABASE_PROPERTIES) $(CONNECTOR_LOG4J_PROPERTIES)
sed -i "s/ohdbuser/$(OH_MARIADB_USER)/g" $(CONNECTOR_APPLICATION_PROPERTIES) $(CONNECTOR_DATABASE_PROPERTIES) $(CONNECTOR_LOG4J_PROPERTIES)
sed -i "s/ohdbpassword/$(OH_MARIADB_PASSWORD)/g" $(CONNECTOR_APPLICATION_PROPERTIES) $(CONNECTOR_DATABASE_PROPERTIES) $(CONNECTOR_LOG4J_PROPERTIES)
sed -i "s/ohlanguage/$(OH_DEMO_LANG)/g" $(CONNECTOR_SETTINGS)