Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CCS
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marko Mecina
CCS
Commits
f4a90d39
Commit
f4a90d39
authored
2 years ago
by
Marko Mecina
Browse files
Options
Downloads
Patches
Plain Diff
add make target for creating DB user
parent
31094b96
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+36
-35
36 additions, 35 deletions
Makefile
README
+9
-4
9 additions, 4 deletions
README
mk_mysql_user.sh
+8
-0
8 additions, 0 deletions
mk_mysql_user.sh
with
53 additions
and
39 deletions
Makefile
+
36
−
35
View file @
f4a90d39
.PHONY
:
install-
confignator ccs-storage codeblockreusefeature install-testlib
.PHONY
:
confignator ccs-storage codeblockreusefeature install-testlib
python-requirements db-user database-dev-env databases
# all: install install-database-dev-env
install
:
python-requirements confignator ccs-storage codeblockreusefeature
install
:
install-python-requirements install-confignator ccs-storage codeblockreusefeature
databases
:
ccs-storage codeblockreusefeature
databases
:
ccs-storage codeblockreusefeature
install-confignator
:
db-user
:
sudo
./mk_mysql_user.sh
$(
USER
)
$(
PW
)
python-requirements
:
@
echo
"+-----------------------------+"
@
echo
"| installing Python modules |"
@
echo
"+-----------------------------+"
if
[
-z
$VIRTUAL_ENV
]
;
then
pip
install
--user
-U
-r
$(
CURDIR
)
/requirements.txt
;
else
pip
install
-U
-r
$(
CURDIR
)
/requirements.txt
;
fi
@
echo
"+-----------------------------+"
@
echo
"| installed Python modules |"
@
echo
"+-----------------------------+"
@
echo
confignator
:
@
echo
"+---------------------------------------+"
@
echo
"+---------------------------------------+"
@
echo
"| installing confignator Python package |"
@
echo
"| installing confignator Python package |"
@
echo
"+---------------------------------------+"
@
echo
"+---------------------------------------+"
...
@@ -18,36 +29,6 @@ install-confignator:
...
@@ -18,36 +29,6 @@ install-confignator:
@
echo
"+--------------------------------------+"
@
echo
"+--------------------------------------+"
@
echo
@
echo
install-testlib
:
@
echo
"+-----------------------------------+"
@
echo
"| installing testlib Python package |"
@
echo
"+-----------------------------------+"
$(
MAKE
)
all
-C
$(
CURDIR
)
/Tst/testing_library
@
echo
"+----------------------------------+"
@
echo
"| installed testlib Python package |"
@
echo
"+----------------------------------+"
@
echo
install-database-dev-env
:
@
echo
"+---------------------------------------------------+"
@
echo
"| installing Python dev packages for the database |"
@
echo
"+---------------------------------------------------+"
$(
MAKE
)
install-devenv
-C
$(
CURDIR
)
/Ccs/database
@
echo
"+---------------------------------------------------+"
@
echo
"| installed Python dev packages for the database |"
@
echo
"+---------------------------------------------------+"
@
echo
install-python-requirements
:
@
echo
"+-----------------------------+"
@
echo
"| installing Python modules |"
@
echo
"+-----------------------------+"
if
[
-z
$VIRTUAL_ENV
]
;
then
pip
install
--user
-U
-r
$(
CURDIR
)
/requirements.txt
;
else
pip
install
-U
-r
$(
CURDIR
)
/requirements.txt
;
fi
@
echo
"+-----------------------------+"
@
echo
"| installed Python modules |"
@
echo
"+-----------------------------+"
@
echo
ccs-storage
:
ccs-storage
:
@
echo
"+----------------------------------------+"
@
echo
"+----------------------------------------+"
@
echo
"| setting up the storage database schema |"
@
echo
"| setting up the storage database schema |"
...
@@ -68,6 +49,26 @@ codeblockreusefeature:
...
@@ -68,6 +49,26 @@ codeblockreusefeature:
@
echo
"+---------------------------------------------------+"
@
echo
"+---------------------------------------------------+"
@
echo
@
echo
database-dev-env
:
@
echo
"+---------------------------------------------------+"
@
echo
"| installing Python dev packages for the database |"
@
echo
"+---------------------------------------------------+"
$(
MAKE
)
install-devenv
-C
$(
CURDIR
)
/Ccs/database
@
echo
"+---------------------------------------------------+"
@
echo
"| installed Python dev packages for the database |"
@
echo
"+---------------------------------------------------+"
@
echo
install-testlib
:
@
echo
"+-----------------------------------+"
@
echo
"| installing testlib Python package |"
@
echo
"+-----------------------------------+"
$(
MAKE
)
all
-C
$(
CURDIR
)
/Tst/testing_library
@
echo
"+----------------------------------+"
@
echo
"| installed testlib Python package |"
@
echo
"+----------------------------------+"
@
echo
set-start-scripts-permissions
:
set-start-scripts-permissions
:
@
echo
"+-----------------------------------------------------+"
@
echo
"+-----------------------------------------------------+"
@
echo
"| setting permissions for the start scripts (execute) |"
@
echo
"| setting permissions for the start scripts (execute) |"
...
...
This diff is collapsed.
Click to expand it.
README
+
9
−
4
View file @
f4a90d39
...
@@ -19,12 +19,18 @@ This file documents the required steps to get the UVIE EGSE software up and runn
...
@@ -19,12 +19,18 @@ This file documents the required steps to get the UVIE EGSE software up and runn
$> sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
$> sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
$> sudo systemctl enable --now mariadb
$> sudo systemctl enable --now mariadb
$> sudo mariadb-secure-installation (optional)
$> sudo mariadb-secure-installation (optional)
To create a MariaDB user, in the CCS base directory execute
$> make db-user USER=<user> PW=<password>
Alternatively, execute the following SQL statements:
mysql> CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
mysql> CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON * . * TO 'user'@'localhost';
mysql> GRANT ALL PRIVILEGES ON * . * TO 'user'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> FLUSH PRIVILEGES;
4) Install Python packages. To install the required modules with pip in userspace or a venv, run
4) Install Python packages. To install the required modules with pip in userspace or a venv, run
'make
install-
python-requirements' in the CCS base directory or use 'pip install [--user] -r requirements.txt'.
'make python-requirements' in the CCS base directory or use 'pip install [--user] -r requirements.txt'.
If using a venv, it must have been created using the --system-site-packages option.
If using a venv, it must have been created using the --system-site-packages option.
For more details, see requirements.txt
For more details, see requirements.txt
...
@@ -35,9 +41,8 @@ In the CCS base directory,
...
@@ -35,9 +41,8 @@ In the CCS base directory,
- first configure the [database] section in egse.cfg!
- first configure the [database] section in egse.cfg!
- then execute:
- then execute:
$> make install-confignator
$> make confignator
$> make ccs-storage
$> make databases
$> make codeblockreusefeature
# MIB
# MIB
Use CCS/Ccs/tools/import_mib.py to import a set of SCOS2000 MIB files into the MySQL mib-schema set in egse.cfg
Use CCS/Ccs/tools/import_mib.py to import a set of SCOS2000 MIB files into the MySQL mib-schema set in egse.cfg
...
...
This diff is collapsed.
Click to expand it.
mk_mysql_user.sh
0 → 100755
+
8
−
0
View file @
f4a90d39
#!/bin/bash
USER
=
$1
PW
=
$2
mysql
-e
"CREATE USER '
${
USER
}
'@'localhost' IDENTIFIED BY '
${
PW
}
';"
mysql
-e
"GRANT ALL PRIVILEGES ON * . * TO '
${
USER
}
'@'localhost';"
mysql
-e
"FLUSH PRIVILEGES;"
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment