forked from konturio/geocint-runner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·176 lines (110 loc) · 9.56 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# to install geocint just run
# make install configuration_file=/path/to/your/config/file/config.inc.sh
export SLACK_CHANNEL = $(shell sed -n -e '/^SLACK_CHANNEL/p' ${configuration_file} | cut -d "=" -f 2)
export SLACK_BOT_NAME = $(shell sed -n -e '/^SLACK_BOT_NAME/p' ${configuration_file} | cut -d "=" -f 2)
export SLACK_BOT_EMOJI = $(shell sed -n -e '/^SLACK_BOT_EMOJI/p' ${configuration_file} | cut -d "=" -f 2)
export SLACK_KEY = $(shell sed -n -e '/^SLACK_KEY/p' ${configuration_file} | cut -d "=" -f 2)
export GEOCINT_WORK_DIRECTORY = $(shell sed -n -e '/^GEOCINT_WORK_DIRECTORY/p' ${configuration_file} | cut -d "=" -f 2)
export CUSTOM_PART_FOLDER_NAME = $(shell sed -n -e '/^CUSTOM_PART_FOLDER_NAME/p' ${configuration_file} | cut -d "=" -f 2)
# -------------------- PREPARATIONS BLOCK -----------------------------------
${GEOCINT_WORK_DIRECTORY}: ## create working directory
mkdir -p $@
${GEOCINT_WORK_DIRECTORY}/geocint: | ${GEOCINT_WORK_DIRECTORY} ## create general_folder directory
mkdir -p $@
${GEOCINT_WORK_DIRECTORY}/geocint/installation: | ${GEOCINT_WORK_DIRECTORY}/geocint ## create installation folder to store installation process marks
mkdir -p $@
${GEOCINT_WORK_DIRECTORY}/geocint/installation/add_congig_file_path_to_bashrc: | ${GEOCINT_WORK_DIRECTORY}/geocint/installation ## write export variable to bashrc file
sudo echo 'export GEOCINT_WORK_DIRECTORY=${GEOCINT_WORK_DIRECTORY}' >> ${HOME}/.bashrc
touch $@
${GEOCINT_WORK_DIRECTORY}/geocint/installation/preparation_block_finished: ${GEOCINT_WORK_DIRECTORY}/geocint/installation/add_congig_file_path_to_bashrc ## send message that preparation step finished successfully
echo "Preparation step finished successfully"
touch $@
# -------------------- DEPENDENCIES INSTALLATIONS BLOCK ----------------------
${GEOCINT_WORK_DIRECTORY}/geocint/installation/runner_installer: ${GEOCINT_WORK_DIRECTORY}/geocint/installation/preparation_block_finished ## install dependencies of runner part
bash ${GEOCINT_WORK_DIRECTORY}/geocint-runner/runner-install.sh || echo 'runner-install.sh returned an error, check logs for more infornation'
touch $@
${GEOCINT_WORK_DIRECTORY}/geocint/installation/private_installer: ${GEOCINT_WORK_DIRECTORY}/geocint/installation/runner_installer ## installs aws cli and system links to public html for the UI
bash ${GEOCINT_WORK_DIRECTORY}/${CUSTOM_PART_FOLDER_NAME}/install.sh || { echo "Error during installation: $(cat ${GEOCINT_WORK_DIRECTORY}/logs/install.log)"; exit 1; }
bash ${GEOCINT_WORK_DIRECTORY}/${CUSTOM_PART_FOLDER_NAME}/install.sh || echo 'install.sh returned an error, check logs for more infornation'
touch $@
${GEOCINT_WORK_DIRECTORY}/geocint/installation/installation_block_finished: ${GEOCINT_WORK_DIRECTORY}/geocint/installation/private_installer ## send message that installation step finished successfully
echo "Installation step finished successfully"
touch $@
# ------------------------ WEB Dashboard installation block ----------------------------
${GEOCINT_WORK_DIRECTORY}/geocint/installation/set_modes: ${GEOCINT_WORK_DIRECTORY}/geocint/installation/preparation_block_finished ## create public_html folder and set access
sudo usermod -aG adm ${USER}
sudo usermod -aG ${USER} www-data
sudo mkdir -p ${GEOCINT_WORK_DIRECTORY}/public_html
sudo chown ${USER}:${USER} ${GEOCINT_WORK_DIRECTORY}/public_html
sudo chmod 0750 ${GEOCINT_WORK_DIRECTORY}/public_html
echo 'GEOCINT_WORK_DIRECTORY=${GEOCINT_WORK_DIRECTORY}' | sudo tee -a /etc/environment
touch $@
${GEOCINT_WORK_DIRECTORY}/geocint/installation/web_dashboard_installation: ${GEOCINT_WORK_DIRECTORY}/geocint/installation/set_modes ${GEOCINT_WORK_DIRECTORY}/geocint/installation/runner_installer
profile_make_init_viewer -o ${GEOCINT_WORK_DIRECTORY}/public_html
ln -sf ${GEOCINT_WORK_DIRECTORY}/geocint/report.json ${GEOCINT_WORK_DIRECTORY}/public_html/
ln -sf ${GEOCINT_WORK_DIRECTORY}/geocint/make.svg ${GEOCINT_WORK_DIRECTORY}/public_html/
ln -sf ${GEOCINT_WORK_DIRECTORY}/geocint/logs ${GEOCINT_WORK_DIRECTORY}/public_html/
cp -r ${GEOCINT_WORK_DIRECTORY}/geocint-runner/report ${GEOCINT_WORK_DIRECTORY}/public_html/;
cp ${GEOCINT_WORK_DIRECTORY}/geocint-runner/index.html ${GEOCINT_WORK_DIRECTORY}/public_html/;
touch $@
${GEOCINT_WORK_DIRECTORY}/geocint/installation/web_dashboard_block_finished: ${GEOCINT_WORK_DIRECTORY}/geocint/installation/web_dashboard_installation ## send message that web dashboard initialisation step finished successfully
echo "web dashboard installation step finished successfully"
touch $@
# ------------------------ MANAGE BLOCK ---------------------------------------
install: ${GEOCINT_WORK_DIRECTORY}/geocint/installation/web_dashboard_block_finished ## Target to run Geocint pipeline installation
echo "Geocint pipeline successfully installed"
# # to install geocint just run
# # make install configuration_file=/path/to/your/config/file/config.inc.sh
# export SLACK_CHANNEL = $(shell sed -n -e '/^SLACK_CHANNEL/p' ${configuration_file} | cut -d "=" -f 2)
# export SLACK_BOT_NAME = $(shell sed -n -e '/^SLACK_BOT_NAME/p' ${configuration_file} | cut -d "=" -f 2)
# export SLACK_BOT_EMOJI = $(shell sed -n -e '/^SLACK_BOT_EMOJI/p' ${configuration_file} | cut -d "=" -f 2)
# export SLACK_KEY = $(shell sed -n -e '/^SLACK_KEY/p' ${configuration_file} | cut -d "=" -f 2)
# export GEOCINT_WORK_DIRECTORY = $(shell sed -n -e '/^GEOCINT_WORK_DIRECTORY/p' ${configuration_file} | cut -d "=" -f 2)
# export CUSTOM_PART_FOLDER_NAME = $(shell sed -n -e '/^CUSTOM_PART_FOLDER_NAME/p' ${configuration_file} | cut -d "=" -f 2)
# # -------------------- PREPARATIONS BLOCK -----------------------------------
# ${GEOCINT_WORK_DIRECTORY}: ## create working directory
# mkdir -p $@
# ${GEOCINT_WORK_DIRECTORY}/geocint: | ${GEOCINT_WORK_DIRECTORY} ## create general_folder directory
# mkdir -p $@
# ${GEOCINT_WORK_DIRECTORY}/geocint/installation: | ${GEOCINT_WORK_DIRECTORY}/geocint ## create installation folder to store installation process marks
# mkdir -p $@
# ${GEOCINT_WORK_DIRECTORY}/geocint/installation/add_congig_file_path_to_bashrc: | ${GEOCINT_WORK_DIRECTORY}/geocint/installation ## write export variable to bashrc file
# sudo echo 'export GEOCINT_WORK_DIRECTORY=${GEOCINT_WORK_DIRECTORY}' >> ${HOME}/.bashrc
# touch $@
# ${GEOCINT_WORK_DIRECTORY}/geocint/installation/preparation_block_finished: ${GEOCINT_WORK_DIRECTORY}/geocint/installation/add_congig_file_path_to_bashrc ## send message that preparation step finished successfully
# echo "Preparation step finished successfully"
# touch $@
# # -------------------- DEPENDENCIES INSTALLATIONS BLOCK ----------------------
# ${GEOCINT_WORK_DIRECTORY}/geocint/installation/runner_installer: ${GEOCINT_WORK_DIRECTORY}/geocint/installation/preparation_block_finished ## install dependencies of runner part
# bash ${GEOCINT_WORK_DIRECTORY}/geocint-runner/runner-install.sh || echo 'runner-install.sh returned an error, check logs for more infornation'
# touch $@
# ${GEOCINT_WORK_DIRECTORY}/geocint/installation/private_installer: ${GEOCINT_WORK_DIRECTORY}/geocint/installation/runner_installer ## installs aws cli and system links to public html for the UI
# bash ${GEOCINT_WORK_DIRECTORY}/${CUSTOM_PART_FOLDER_NAME}/install.sh || { echo "Error during installation: $(cat ${GEOCINT_WORK_DIRECTORY}/logs/install.log)"; exit 1; }
# bash ${GEOCINT_WORK_DIRECTORY}/${CUSTOM_PART_FOLDER_NAME}/install.sh || echo 'install.sh returned an error, check logs for more infornation'
# touch $@
# ${GEOCINT_WORK_DIRECTORY}/geocint/installation/installation_block_finished: ${GEOCINT_WORK_DIRECTORY}/geocint/installation/private_installer ## send message that installation step finished successfully
# echo "Installation step finished successfully"
# touch $@
# # ------------------------ WEB Dashboard installation block ----------------------------
# ${GEOCINT_WORK_DIRECTORY}/geocint/installation/set_modes: ${GEOCINT_WORK_DIRECTORY}/geocint/installation/preparation_block_finished ## create public_html folder and set access
# sudo usermod -aG adm ${USER}
# sudo usermod -aG ${USER} www-data
# sudo mkdir -p ${GEOCINT_WORK_DIRECTORY}/public_html
# sudo chown ${USER}:${USER} ${GEOCINT_WORK_DIRECTORY}/public_html
# sudo chmod 0750 ${GEOCINT_WORK_DIRECTORY}/public_html
# echo 'GEOCINT_WORK_DIRECTORY=${GEOCINT_WORK_DIRECTORY}' | sudo tee -a /etc/environment
# touch $@
# ${GEOCINT_WORK_DIRECTORY}/geocint/installation/web_dashboard_installation: ${GEOCINT_WORK_DIRECTORY}/geocint/installation/set_modes ${GEOCINT_WORK_DIRECTORY}/geocint/installation/runner_installer
# profile_make_init_viewer -o= ${GEOCINT_WORK_DIRECTORY}/public_html
# ln -s ${GEOCINT_WORK_DIRECTORY}/geocint/report.json ${GEOCINT_WORK_DIRECTORY}/public_html/report.json
# ln -s ${GEOCINT_WORK_DIRECTORY}/geocint/make.svg ${GEOCINT_WORK_DIRECTORY}/public_html/make.svg
# ln -s ${GEOCINT_WORK_DIRECTORY}/geocint/logs ${GEOCINT_WORK_DIRECTORY}/public_html/logs
# cp -r ${GEOCINT_WORK_DIRECTORY}/geocint/report ${GEOCINT_WORK_DIRECTORY}/public_html/report
# cp ${GEOCINT_WORK_DIRECTORY}/geocint/index.html ${GEOCINT_WORK_DIRECTORY}/public_html/index.html
# touch $@
# ${GEOCINT_WORK_DIRECTORY}/geocint/installation/web_dashboard_block_finished: ${GEOCINT_WORK_DIRECTORY}/geocint/installation/web_dashboard_installation ## send message that web dashboard initialisation step finished successfully
# echo "web dashboard installation step finished successfully"
# touch $@
# # ------------------------ MANAGE BLOCK ---------------------------------------
# install: ${GEOCINT_WORK_DIRECTORY}/geocint/installation/web_dashboard_block_finished ## Target to run Geocint pipeline installation
# echo "Geocint pipeline successfully installed"