Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
275b915d
Commit
275b915d
authored
6 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Specify internal port within template command
parent
855816f0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
man/freedombone-template.1.gz
+0
-0
0 additions, 0 deletions
man/freedombone-template.1.gz
src/freedombone-template
+73
-53
73 additions, 53 deletions
src/freedombone-template
with
73 additions
and
53 deletions
man/freedombone-template.1.gz
+
0
−
0
View file @
275b915d
No preview for this file type
This diff is collapsed.
Click to expand it.
src/freedombone-template
+
73
−
53
View file @
275b915d
...
...
@@ -32,7 +32,7 @@ app_name='noapp'
app_name_lower
=
$(
echo
"
${
app_name
}
"
|
tr
'[:upper:]'
'[:lower:]'
)
app_name
=
$app_name_lower
app_name_upper
=
$(
echo
"
${
app_name
}
"
|
tr
'[:lower:]'
'[:upper:]'
)
app_repo
=
"TODO"
app_repo
=
app_repo_commit
=
'TODO'
app_php
=
app_node
=
...
...
@@ -75,6 +75,7 @@ function show_help {
echo
$' -d --database [mariadb|postgresql|mongodb] Type of database'
echo
$' -w --web [yes|no] Whether there is a web user interface (default is yes)'
echo
$' --dir [directory] Where to install to'
echo
$' -i --internalport [number] Internal port number for the daemon'
echo
''
exit
0
}
...
...
@@ -114,6 +115,10 @@ do
shift
database_type
=
"
$1
"
;;
-i
|
--internal
|
--internalport
)
shift
app_port_internal
=
"
$1
"
;;
-p
|
--php
)
shift
app_php
=
"
$1
"
...
...
@@ -263,8 +268,10 @@ if [ "$app_port" ]; then
echo
"
${
app_name_upper
}
_PORT=
$app_port
"
fi
echo
"
${
app_name_upper
}
_ONION_PORT=
$((
(
RANDOM
%
1000
)
+
9010
))
"
echo
"
${
app_name_upper
}
_REPO=
\"
${
app_repo
}
\"
"
echo
"
${
app_name_upper
}
_COMMIT='
${
app_repo_commit
}
'"
if
[
"
$app_repo
"
]
;
then
echo
"
${
app_name_upper
}
_REPO=
\"
${
app_repo
}
\"
"
echo
"
${
app_name_upper
}
_COMMIT='
${
app_repo_commit
}
'"
fi
if
[
$app_daemon
]
;
then
if
[
!
"
$app_port_internal
"
]
;
then
echo
"
${
app_name_upper
}
_PORT_INTERNAL=TODO"
...
...
@@ -391,27 +398,31 @@ echo ' done'
echo
'}'
echo
''
echo
"function upgrade_
${
app_name
}
{"
echo
" CURR_
${
app_name_upper
}
_COMMIT=
\$
(get_completion_param
\"
${
app_name
}
commit
\"
)"
echo
" if [[
\"\$
CURR_
${
app_name_upper
}
_COMMIT
\"
==
\"\$
${
app_name_upper
}
_COMMIT
\"
]]; then"
echo
' return'
echo
' fi'
if
[
$app_webui
]
;
then
echo
''
echo
" if grep -q
\"
${
app_name
}
domain
\"
\"\$
COMPLETION_FILE
\"
; then"
echo
"
${
app_name_upper
}
_DOMAIN_NAME=
\$
(get_completion_param
\"
${
app_name
}
domain
\"
)"
echo
' fi'
fi
echo
''
echo
' # update to the next commit'
if
[
!
"
$app_dir
"
]
;
then
echo
" set_repo_commit
\"
/var/www/
\$
${
app_name_upper
}
_DOMAIN_NAME/htdocs
\"
\"
${
app_name
}
commit
\"
\"\$
${
app_name_upper
}
_COMMIT
\"
\"\$
${
app_name_upper
}
_REPO
\"
"
echo
" chown -R www-data:www-data
\"
/var/www/
\$
{
${
app_name_upper
}
_DOMAIN_NAME}/htdocs
\"
"
if
[
!
"
$app_repo
"
]
;
then
echo
"echo -n ''"
else
echo
" set_repo_commit
\"
${
app_dir
}
\"
\"
${
app_name
}
commit
\"
\"\$
${
app_name_upper
}
_COMMIT
\"
\"\$
${
app_name_upper
}
_REPO
\"
"
echo
" chown -R
${
app_name
}
:
${
app_name
}
\"
${
app_dir
}
\"
"
fi
if
[
$app_daemon
]
;
then
echo
" systemctl restart
${
app_name
}
"
echo
" CURR_
${
app_name_upper
}
_COMMIT=
\$
(get_completion_param
\"
${
app_name
}
commit
\"
)"
echo
" if [[
\"\$
CURR_
${
app_name_upper
}
_COMMIT
\"
==
\"\$
${
app_name_upper
}
_COMMIT
\"
]]; then"
echo
' return'
echo
' fi'
if
[
$app_webui
]
;
then
echo
''
echo
" if grep -q
\"
${
app_name
}
domain
\"
\"\$
COMPLETION_FILE
\"
; then"
echo
"
${
app_name_upper
}
_DOMAIN_NAME=
\$
(get_completion_param
\"
${
app_name
}
domain
\"
)"
echo
' fi'
fi
echo
''
echo
' # update to the next commit'
if
[
!
"
$app_dir
"
]
;
then
echo
" set_repo_commit
\"
/var/www/
\$
${
app_name_upper
}
_DOMAIN_NAME/htdocs
\"
\"
${
app_name
}
commit
\"
\"\$
${
app_name_upper
}
_COMMIT
\"
\"\$
${
app_name_upper
}
_REPO
\"
"
echo
" chown -R www-data:www-data
\"
/var/www/
\$
{
${
app_name_upper
}
_DOMAIN_NAME}/htdocs
\"
"
else
echo
" set_repo_commit
\"
${
app_dir
}
\"
\"
${
app_name
}
commit
\"
\"\$
${
app_name_upper
}
_COMMIT
\"
\"\$
${
app_name_upper
}
_REPO
\"
"
echo
" chown -R
${
app_name
}
:
${
app_name
}
\"
${
app_dir
}
\"
"
fi
if
[
$app_daemon
]
;
then
echo
" systemctl restart
${
app_name
}
"
fi
fi
echo
'}'
echo
''
...
...
@@ -775,42 +786,51 @@ if [ $app_webui ]; then
echo
' fi'
fi
echo
" if [ -d /repos/
${
app_name
}
]; then"
if
[
$app_webui
]
;
then
echo
" mkdir
\"
/var/www/
\$
${
app_name_upper
}
_DOMAIN_NAME/htdocs
\"
"
fi
if
[
!
"
$app_dir
"
]
;
then
echo
" cp -r -p /repos/
${
app_name
}
/.
\"
/var/www/
\$
${
app_name_upper
}
_DOMAIN_NAME/htdocs
\"
"
echo
" cd
\"
/var/www/
\$
${
app_name_upper
}
_DOMAIN_NAME/htdocs
\"
|| exit 324687356"
else
echo
" cp -r -p /repos/
${
app_name
}
/.
\"
${
app_dir
}
\"
"
echo
" cd
\"
${
app_dir
}
\"
|| exit 36487365"
fi
echo
' git pull'
echo
' else'
if
[
!
"
$app_dir
"
]
;
then
echo
" git_clone
\"\$
${
app_name_upper
}
_REPO
\"
\"
/var/www/
\$
${
app_name_upper
}
_DOMAIN_NAME/htdocs
\"
"
else
echo
" git_clone
\"\$
${
app_name_upper
}
_REPO
\"
\"
${
app_dir
}
\"
"
fi
echo
' fi'
echo
''
if
[
!
"
$app_dir
"
]
;
then
echo
" if [ ! -d
\"
/var/www/
\$
${
app_name_upper
}
_DOMAIN_NAME/htdocs
\"
]; then"
if
[
"
$app_repo
"
]
;
then
echo
" if [ -d /repos/
${
app_name
}
]; then"
if
[
$app_webui
]
;
then
echo
" mkdir
\"
/var/www/
\$
${
app_name_upper
}
_DOMAIN_NAME/htdocs
\"
"
fi
if
[
!
"
$app_dir
"
]
;
then
echo
" cp -r -p /repos/
${
app_name
}
/.
\"
/var/www/
\$
${
app_name_upper
}
_DOMAIN_NAME/htdocs
\"
"
echo
" cd
\"
/var/www/
\$
${
app_name_upper
}
_DOMAIN_NAME/htdocs
\"
|| exit 324687356"
else
echo
" cp -r -p /repos/
${
app_name
}
/.
\"
${
app_dir
}
\"
"
echo
" cd
\"
${
app_dir
}
\"
|| exit 36487365"
fi
echo
' git pull'
echo
' else'
if
[
!
"
$app_dir
"
]
;
then
echo
" git_clone
\"\$
${
app_name_upper
}
_REPO
\"
\"
/var/www/
\$
${
app_name_upper
}
_DOMAIN_NAME/htdocs
\"
"
else
echo
" git_clone
\"\$
${
app_name_upper
}
_REPO
\"
\"
${
app_dir
}
\"
"
fi
echo
' fi'
echo
''
if
[
!
"
$app_dir
"
]
;
then
echo
" if [ ! -d
\"
/var/www/
\$
${
app_name_upper
}
_DOMAIN_NAME/htdocs
\"
]; then"
else
echo
" if [ ! -d
\"
${
app_dir
}
\"
]; then"
fi
echo
" echo
\$
'Unable to clone
${
app_name
}
repo'"
echo
' exit 87525'
echo
' fi'
echo
''
else
echo
" if [ ! -d
\"
${
app_dir
}
\"
]; then"
echo
" mkdir -p
\"
/var/www/
\$
${
app_name_upper
}
_DOMAIN_NAME/htdocs
\"
"
if
[
"
$app_dir
"
]
;
then
echo
" mkdir
\"
${
app_dir
}
\"
"
fi
fi
echo
" echo
\$
'Unable to clone
${
app_name
}
repo'"
echo
' exit 87525'
echo
' fi'
echo
''
if
[
!
"
$app_dir
"
]
;
then
echo
" cd
\"
/var/www/
\$
${
app_name_upper
}
_DOMAIN_NAME/htdocs
\"
|| exit 36587356"
else
echo
" cd
\"
${
app_dir
}
\"
|| exit 3463754637"
fi
echo
" git checkout
\"\$
${
app_name_upper
}
_COMMIT
\"
-b
\"\$
${
app_name_upper
}
_COMMIT
\"
"
echo
" set_completion_param
\"
${
app_name
}
commit
\"
\"\$
${
app_name_upper
}
_COMMIT
\"
"
if
[
"
$app_repo
"
]
;
then
echo
" git checkout
\"\$
${
app_name_upper
}
_COMMIT
\"
-b
\"\$
${
app_name_upper
}
_COMMIT
\"
"
echo
" set_completion_param
\"
${
app_name
}
commit
\"
\"\$
${
app_name_upper
}
_COMMIT
\"
"
fi
if
[
$app_webui
]
;
then
echo
''
echo
" chmod g+w
\"
/var/www/
\$
${
app_name_upper
}
_DOMAIN_NAME/htdocs
\"
"
...
...
@@ -951,7 +971,7 @@ if [ $app_daemon ]; then
echo
" echo 'Description=
${
app_name
}
';"
echo
" echo 'After=syslog.target';"
echo
" echo 'After=network.target';"
echo
" echo
'
Documentation=
${
app_name_upper
}
_REPO"
;
echo
" echo
\"
Documentation=
\$
${
app_name_upper
}
_REPO
\"
;
"
;
echo
" echo '';"
echo
" echo '[Service]';"
echo
" echo 'Type=simple';"
...
...
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