Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EventsAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jards
EventsAPI
Commits
e42ea233
Commit
e42ea233
authored
7 years ago
by
Carsten Karbach
Browse files
Options
Downloads
Patches
Plain Diff
Add composer and synch script for direct installation
parent
bad70cb5
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
composer.phar
+0
-0
0 additions, 0 deletions
composer.phar
utils/sync.sh
+82
-0
82 additions, 0 deletions
utils/sync.sh
with
82 additions
and
0 deletions
composer.phar
0 → 100755
+
0
−
0
View file @
e42ea233
File added
This diff is collapsed.
Click to expand it.
utils/sync.sh
0 → 100755
+
82
−
0
View file @
e42ea233
#Script to synchronize local directory to a remote webserver
#Replace username and hostname with the appropriate values for your own configuration
#This script must be executed from the root of the repository as working directory.
#Call this script as: ./sync.sh './' karbach zam2015
#Or when using a different remote folder ./sync.sh './' karbach zam2015 remote-folder
#
#This script can also be used to only fix the file permissions:
#E.g. by calling it like this: ./synch.sh './'
#Only use the folder parameter for that to work
#
FOLDER
=
$1
USER
=
$2
HOST
=
$3
PORTPART
=
""
# checking if another remote folder should be used
if
[
-z
"
$4
"
]
then
REMOTE
=
"~/htdocs/antragssystem/"
else
REMOTE
=
"
$4
/"
fi
# checking if another port option is needed, e.g. -e "ssh -p 2244"
if
[
-z
"
$5
"
]
then
PORTPART
=
"ssh"
else
PORTPART
=
"
$5
"
fi
CDIR
=
`
pwd
`
if
[
"
$USER
"
==
""
]
then
echo
"Only setting file permissions in folder
$FOLDER
"
else
echo
"synchronizing
$FOLDER
in
$CDIR
with user
$USER
@
$HOST
:
$REMOTE
"
fi
find
$FOLDER
-type
d
-exec
chmod
711
{}
+
find
$FOLDER
-type
f
-exec
chmod
644
{}
+
find
$FOLDER
-type
f
-name
'*.pl'
-exec
chmod
711
{}
+
find
$FOLDER
-type
f
-name
'*.log'
-exec
chmod
666
{}
+
find
$FOLDER
-type
f
-name
'*.sh'
-exec
chmod
711
{}
+
find
$FOLDER
-type
f
-name
'*.shell'
-exec
chmod
711
{}
+
find
$FOLDER
-type
f
-name
'*.phar'
-exec
chmod
711
{}
+
find
$FOLDER
-type
f
-name
'pre-commit'
-exec
chmod
711
{}
+
chmod
777
'./data'
COMPOSER_SUCCESS
=
1
if
[
-f
"
$FOLDER
/composer.phar"
]
;
then
if
command
-v
php
>
/dev/null
&&
\
php
"
$FOLDER
/composer.phar"
self-update
&&
\
php
"
$FOLDER
/composer.phar"
install
;
then
echo
"Running composer seemed to be successful."
else
echo
"PHP not installed or composer failed, so we cannot install composer dependencies!"
COMPOSER_SUCCESS
=
0
if
[
"
$USER
"
!=
""
]
;
then
echo
"Will try to run composer on target machine after sync..."
fi
fi
else
echo
"No composer.phar in source-directory. Assuming old branch? Should not happen, though..."
fi
if
[
"
$USER
"
!=
""
]
then
if
[
"
$COMPOSER_SUCCESS
"
==
"1"
]
;
then
/usr/bin/rsync
--exclude
=
.git
--delete
-avrp
-e
"
$PORTPART
"
$FOLDER
"
$USER
"
@
"
$HOST
"
:
$REMOTE
else
/usr/bin/rsync
--exclude
=
.git
--exclude
=
vendor/
--delete
-avrp
-e
"
$PORTPART
"
$FOLDER
"
$USER
"
@
"
$HOST
"
:
$REMOTE
if
$PORTPART
"
$USER
"
@
"
$HOST
"
"bash -c 'cd
$REMOTE
;php composer.phar self-update && php composer.phar install; exit "
'$'
"?'"
;
then
echo
"Installed composer dependencies on remote machine..."
else
echo
"ERROR: Installing composer dependencies on remote machine failed!"
fi
fi
fi
\ 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