Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
4d8ebba5
Commit
4d8ebba5
authored
Apr 02, 2020
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updates
parent
0c3f9257
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
25 deletions
+40
-25
createbytask.int.sh
vz/azbyka/createbytask.int.sh
+3
-1
createbytask.sh
vz/azbyka/createbytask.sh
+37
-24
No files found.
vz/azbyka/createbytask.int.sh
View file @
4d8ebba5
...
...
@@ -327,7 +327,9 @@ rmdir *.tar 2>/dev/null
# common project
if
[
-n
"
$AUSERID
"
]
;
then
if
[
-n
"
$DOCKID
"
]
;
then
tune_hosts_azbyka_a05
#tune_hosts_azbyka_a05
# set in docker-compose
true
else
tune_hosts_azbyka
fi
...
...
vz/azbyka/createbytask.sh
View file @
4d8ebba5
...
...
@@ -87,38 +87,49 @@ assure $VEID
# TODO: do via docker compose
# TODO: user Dockerfile
if
[
-n
"
$DOCKID
"
]
;
then
mkdir
-p
composers/
$AUSER
/
cat
<<
EOF
> composers/
$AUSER
/docker-compose.yml
version: '3.3'
services:
mkdir
-p
composers/sites.d/
cat
<<
EOF
> composers/sites.d/
$AUSER
.yml
$AUSER
:
container_name:
$AUSER
restart: always
image: docker.hub.eterfund.ru/2hatokhin/containers/altlinux-p9:latest
build: dockers/altlinux-p9-apache2-php7
command:
- /sbin/systemd
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup
-
$HOSTHOME
/
$AUSER
:/home/
$AUSER
EOF
if
[
-n
"
$DOCKVOLUME
"
]
;
then
cat
<<
EOF
>> composers/sites.d/
$AUSER
.yml
-
$DOCKVOLUME
EOF
fi
cat
<<
EOF
>> composers/sites.d/
$AUSER
.yml
cap_add:
- SYS_ADMIN
extra_hosts:
# - "mysql:172.18.0.3"
- "memcached:172.18.0.2"
- "redis:172.18.0.2"
- "sphinx.azbyka:
$SPHINXHOST
"
- "memcached memcached.azbyka:
$MEMCACHEDHOST
"
- "redis redis.azbyka:
$MEMCACHEDHOST
"
- "mysql mysql.azbyka mysql.
$AUSER
:
$MYSQLHOST
"
- "mariadb mariadb.azbyka mariadb.
$AUSER
:
$MYSQLHOST
"
networks:
- default
# default:
# Error response from daemon: Invalid address 178.18.0.125: It does not belong to any of this network's subnets
# ipv4_address:
$VEIP
networks:
default:
external:
name: azbyka_default
default:
ipv4_address:
$VEIP
EOF
cd
composers/
$AUSER
docker-compose create
||
fatal
cd
-
composers/update_compose.sh
#cd composers
DOCKID
=
$AUSER
#evz destroy $DOCKID
docker-compose
-f
composers/docker-compose.yml
-p
$BASENAME
create
$DOCKID
||
fatal
#cd -
docker start
$DOCKID
||
fatal
VEIP
=
$(
docker inspect
-f
'{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'
$DOCKID
)
#
VEIP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $DOCKID)
else
if
!
vzlist
-a
|
grep
"
$VEIP
"
;
then
vzctl create
$VEID
--ostemplate
=
$TEMPLATE
||
fatal
...
...
@@ -161,9 +172,11 @@ st()
# TODO: first time only or force?
if
true
;
then
st update_chrooted conf
st epm update
st epm
--auto
install
eepm
st epm
--auto
upgrade
if
[
-n
"
$VEIDORIG
"
]
;
then
st epm update
st epm
--auto
install
eepm
st epm
--auto
upgrade
fi
fi
...
...
@@ -171,8 +184,8 @@ fi
if
[
-n
"
$VEIDORIG
"
]
;
then
# copy nginx config from a01
if
[
!
-s
"/etc/nginx/sites-enabled.d/azbyka.d/
$NAME
.conf"
]
;
then
hostserver
cat
/var/lib/vz/root/900/etc/nginx/sites-enabled.d/azbyka.d/
$NAME
.conf
>
/etc/nginx/sites-enabled.d/azbyka.d/
$NAME
.conf
hostserver
cat
/var/lib/vz/root/900/etc/nginx/sites-enabled.d/azbyka.d/
$NAME
-manual
.conf
>
/etc/nginx/sites-enabled.d/azbyka.d/
$NAME
-manual
.conf
hostserver
cat
/var/lib/vz/root/900/etc/nginx/sites-enabled.d/azbyka.d/
$NAME
.conf
|
sed
-e
"s|/home/|/azbyka/|"
>
/etc/nginx/sites-enabled.d/azbyka.d/
$NAME
.conf
hostserver
cat
/var/lib/vz/root/900/etc/nginx/sites-enabled.d/azbyka.d/
$NAME
-manual
.conf
|
sed
-e
"s|/home/|/azbyka/|"
>
/etc/nginx/sites-enabled.d/azbyka.d/
$NAME
-manual
.conf
[
-s
/etc/nginx/sites-enabled.d/azbyka.d/
$NAME
-manual
.conf
]
||
rm
-f
/etc/nginx/sites-enabled.d/azbyka.d/
$NAME
-manual
.conf
hostserver
cat
/var/lib/vz/root/900/etc/nginx/include/static-fallback-
$NAME
.conf
>
/etc/nginx/include/static-fallback-
$NAME
.conf
fi
...
...
@@ -186,7 +199,7 @@ upstream sites8$VEPORT {
}
EOF
serv nginx reload
if
[
!
-s
"apache/
$ACONF
.conf"
]
;
then
hostserver
cat
/var/lib/vz/root/
$VEIDORIG
/etc/httpd2/conf/sites-enabled/
$ACONF
.conf
>
apache/
$ACONF
.conf
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment