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
976a94f6
Commit
976a94f6
authored
Aug 03, 2015
by
Visay Keo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEATURE] Add possibility to overwrite remote path
parent
94732bb1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
README.md
README.md
+8
-0
bin/syncontent
bin/syncontent
+11
-4
No files found.
README.md
View file @
976a94f6
...
@@ -27,6 +27,12 @@ bin/syncontent demo-014-007
...
@@ -27,6 +27,12 @@ bin/syncontent demo-014-007
-
You need to make sure that you have auto login with public key to
`demo-014-007@10.10.10.27`
-
You need to make sure that you have auto login with public key to
`demo-014-007@10.10.10.27`
-
Only
`latest`
or
`demo`
is supported at the moment. We don't recommend you to have autologin access to the live site
-
Only
`latest`
or
`demo`
is supported at the moment. We don't recommend you to have autologin access to the live site
-
You can only run the command from the root directory of your project
-
You can only run the command from the root directory of your project
-
If your remote path is in another directory below
`public_html`
, set it in the second argument like below:
```
bash
bin/syncontent demo-014-007 neosbox
bin/syncontent demo-014-007 neosbox/my_root_dir
```
### Customization
### Customization
...
@@ -58,6 +64,8 @@ And the script will automatically take `demo-014-007` as the content master.
...
@@ -58,6 +64,8 @@ And the script will automatically take `demo-014-007` as the content master.
-
There should be only one master at a time. That means you should not have more than more file in the
`config/master`
-
There should be only one master at a time. That means you should not have more than more file in the
`config/master`
directory. In case there are more than one file exists, the script will take first file only to process.
directory. In case there are more than one file exists, the script will take first file only to process.
-
With this mode, you cannot overwrite the remote path as argument. This will come in the next release of this package.
## Author
## Author
Visay Keo
<visay@web-essentials.asia>
Visay Keo
<visay@web-essentials.asia>
...
...
bin/syncontent
View file @
976a94f6
#!/bin/bash
#!/bin/bash
ARG
=
$1
USER_NAME
=
$1
ROOT_DIR
=
`
pwd
`
ROOT_DIR
=
`
pwd
`
PACKAGE_DIR
=
"
${
ROOT_DIR
}
/Packages/Libraries/visay/syncontent"
PACKAGE_DIR
=
"
${
ROOT_DIR
}
/Packages/Libraries/visay/syncontent"
if
[
-z
"
${
ARG
}
"
]
;
then
if
[
-z
"
${
USER_NAME
}
"
]
;
then
MASTER
=
`
ls
${
PACKAGE_DIR
}
/config/master |
sort
-n
|
head
-1
`
MASTER
=
`
ls
${
PACKAGE_DIR
}
/config/master |
sort
-n
|
head
-1
`
else
else
MASTER
=
"
${
ARG
}
"
MASTER
=
"
${
USER_NAME
}
"
REMOTE_DIR
=
$2
fi
fi
if
[
-z
"
${
MASTER
}
"
]
;
then
if
[
-z
"
${
MASTER
}
"
]
;
then
...
@@ -37,6 +38,12 @@ if [ "${PING}" != "OK" ]; then
...
@@ -37,6 +38,12 @@ if [ "${PING}" != "OK" ]; then
exit
0
exit
0
fi
fi
if
[
-z
"
${
REMOTE_DIR
}
"
]
;
then
REMOTE_PATH
=
"/home/
${
SSH_USER
}
/public_html"
else
REMOTE_PATH
=
"/home/
${
SSH_USER
}
/public_html/
${
REMOTE_DIR
}
"
fi
# Use Development context if Flow Context is not set
# Use Development context if Flow Context is not set
FLOW_CONTEXT
=
${
FLOW_CONTEXT
:
=Development
}
FLOW_CONTEXT
=
${
FLOW_CONTEXT
:
=Development
}
...
@@ -46,7 +53,7 @@ ansible-playbook -i ${PACKAGE_DIR}/ansible/hosts.ini ${PACKAGE_DIR}/ansible/play
...
@@ -46,7 +53,7 @@ ansible-playbook -i ${PACKAGE_DIR}/ansible/hosts.ini ${PACKAGE_DIR}/ansible/play
--extra-vars
"stage=
${
STAGE
}
--extra-vars
"stage=
${
STAGE
}
ssh_user=
${
SSH_USER
}
ssh_user=
${
SSH_USER
}
local_path=
${
ROOT_DIR
}
local_path=
${
ROOT_DIR
}
remote_path=
/home/
${
SSH_USER
}
/public_html
remote_path=
${
REMOTE_PATH
}
local_flow_context=
${
FLOW_CONTEXT
}
"
local_flow_context=
${
FLOW_CONTEXT
}
"
echo
"Sync content from
${
STAGE
}
completed!"
echo
"Sync content from
${
STAGE
}
completed!"
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