Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
syncontent
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Web Essentials Jira
Web Essentials Jira
Labels
Merge Requests
0
Merge Requests
0
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Visay Keo
syncontent
Commits
82cae226
Commit
82cae226
authored
Sep 13, 2015
by
Visay Keo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEATURE] Allow setting of php path on remote
parent
ab7d42b6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
7 deletions
+34
-7
CHANGELOG
CHANGELOG
+5
-4
README.md
README.md
+4
-2
ansible/roles/database/tasks/main.yml
ansible/roles/database/tasks/main.yml
+1
-1
bin/syncontent
bin/syncontent
+24
-0
No files found.
CHANGELOG
View file @
82cae226
CHANGELOG
CHANGELOG
=========
=========
3.0
-dev
3.0
.1
-----
----
-----
- [BUGFIX] Use eval to execute shell from string
- [FEATURE] Allow setting of php path on remote
- [IMP] Group ansible params into variable
- [BUGFIX] Use eval to execute shell from string
- [IMP] Group ansible params into variable
3.0.0
3.0.0
-----
-----
...
...
README.md
View file @
82cae226
...
@@ -52,9 +52,10 @@ bin/syncontent -u=demo-014-007 -h=10.10.10.37 -p=/home/user/neosbox
...
@@ -52,9 +52,10 @@ bin/syncontent -u=demo-014-007 -h=10.10.10.37 -p=/home/user/neosbox
-
`-h`
|
`--remote-host`
: Set the hostname or IP address of the remote server (__Default__:
`10.10.10.27`
)
-
`-h`
|
`--remote-host`
: Set the hostname or IP address of the remote server (__Default__:
`10.10.10.27`
)
-
`-p`
|
`--remote-path`
: Set path to the document root on the remote server (__Default__:
`/home/<remote-user>/public_html`
)
-
`-p`
|
`--remote-path`
: Set path to the document root on the remote server (__Default__:
`/home/<remote-user>/public_html`
)
-
`-t`
|
`--ansible-tags`
: Set the specific task you want run. See available sysc tasks section for details
-
`-t`
|
`--ansible-tags`
: Set the specific task you want run. See available sysc tasks section for details
-
`--remote-php`
: Set the path to php on the remote server
-
`-v`
: Set the verbosity of ansible output. You can also set more verbose by adding more
`v`
like
`-vvvvv`
-
`-v`
: Set the verbosity of ansible output. You can also set more verbose by adding more
`v`
like
`-vvvvv`
-
`--dry-run`
: Force to display the command to execute but won't run them. Useful for debugging when you want
-
`--dry-run`
: Force to display the command to execute but won't run them. Useful for debugging when you want
to see the full ansible command and maybe execute them directly for better error hints
to see the full ansible command and maybe execute them directly for better error hints
### Customization
### Customization
...
@@ -75,11 +76,12 @@ Packages
...
@@ -75,11 +76,12 @@ Packages
└── README.md
└── README.md
```
```
You can also overwrite the default value of
`--remote-host`
and
`--remote-path
`
by setting it in the created master file.
You can also overwrite the default value of
`--remote-host`
,
`--remote-path`
and
`--remote-php
`
by setting it in the created master file.
```
Packages/Libraries/visay/syncontent/config/master/demo-014-007
```
Packages/Libraries/visay/syncontent/config/master/demo-014-007
--remote-host=10.10.10.37
--remote-host=10.10.10.37
--remote-path=/home/user/neosbox
--remote-path=/home/user/neosbox
--remote-php=/opt/php-versions/php55/bin/php
```
```
With this file and its content, you can now execute the content sync with just:
With this file and its content, you can now execute the content sync with just:
...
...
ansible/roles/database/tasks/main.yml
View file @
82cae226
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# tasks file for database
# tasks file for database
-
name
:
Read remote database info (FLOW_CONTEXT=Production)
-
name
:
Read remote database info (FLOW_CONTEXT=Production)
shell
:
FLOW_CONTEXT=Production ./flow configuration:show --type Settings --path TYPO3.Flow.persistence.backendOptions chdir="{{ remote_path }}"
shell
:
FLOW_CONTEXT=Production
{{ remote_php | default('') }}
./flow configuration:show --type Settings --path TYPO3.Flow.persistence.backendOptions chdir="{{ remote_path }}"
register
:
db_info
register
:
db_info
-
name
:
Get remote database host
-
name
:
Get remote database host
...
...
bin/syncontent
View file @
82cae226
...
@@ -33,6 +33,10 @@ do
...
@@ -33,6 +33,10 @@ do
ANSIBLE_TAGS
=
"--tags=
${
ARGS
#*=
}
"
ANSIBLE_TAGS
=
"--tags=
${
ARGS
#*=
}
"
shift
shift
;;
;;
--remote-php
=
*
)
REMOTE_PHP
=
"
${
ARGS
#*=
}
"
shift
;;
-v
*
)
-v
*
)
VERBOSE_LEVEL
=
"
${
ARGS
}
"
VERBOSE_LEVEL
=
"
${
ARGS
}
"
shift
shift
...
@@ -124,6 +128,23 @@ if [ -z "${REMOTE_PATH}" ]; then
...
@@ -124,6 +128,23 @@ if [ -z "${REMOTE_PATH}" ]; then
fi
fi
fi
fi
# If remote php is not set in argument, check for it in the configuration file
if
[
-z
"
${
REMOTE_PHP
}
"
]
;
then
if
[
-f
"
${
MASTER_FILE
}
"
]
;
then
IFS
=
$'
\n
'
for
LINE
in
`
cat
${
MASTER_FILE
}
`
do
LINE
=
${
LINE
//[[
:blank:]]/
}
case
${
LINE
}
in
--remote-php
=
*
)
REMOTE_PHP
=
"
${
LINE
#*=
}
"
shift
;;
esac
done
fi
fi
# If remote path is not defined anywhere, set a standard value
# If remote path is not defined anywhere, set a standard value
if
[
-z
"
${
REMOTE_PATH
}
"
]
;
then
if
[
-z
"
${
REMOTE_PATH
}
"
]
;
then
REMOTE_PATH
=
"/home/
${
REMOTE_USER
}
/public_html"
REMOTE_PATH
=
"/home/
${
REMOTE_USER
}
/public_html"
...
@@ -152,6 +173,9 @@ fi
...
@@ -152,6 +173,9 @@ fi
# Prepare all parameters for ansible extra vars
# Prepare all parameters for ansible extra vars
ANSIBLE_EXTRA_VARS
=
"stage=
${
STAGE
}
ssh_user=
${
REMOTE_USER
}
local_path=
${
ROOT_DIR
}
remote_path=
${
REMOTE_PATH
}
local_flow_context=
${
FLOW_CONTEXT
}
"
ANSIBLE_EXTRA_VARS
=
"stage=
${
STAGE
}
ssh_user=
${
REMOTE_USER
}
local_path=
${
ROOT_DIR
}
remote_path=
${
REMOTE_PATH
}
local_flow_context=
${
FLOW_CONTEXT
}
"
if
[
-n
"
${
REMOTE_PHP
}
"
]
;
then
ANSIBLE_EXTRA_VARS
=
"
${
ANSIBLE_EXTRA_VARS
}
remote_php=
${
REMOTE_PHP
}
"
fi
echo
-e
${
GREEN
}
"ENVIRONMENT SUMMARY:"
${
NC
}
echo
-e
${
GREEN
}
"ENVIRONMENT SUMMARY:"
${
NC
}
echo
"====================="
echo
"====================="
...
...
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