Skip to content
This repository was archived by the owner on Oct 30, 2018. It is now read-only.

Commit 76a7738

Browse files
authored
Merge pull request #37 from Syncano/release-v0.4
Release v0.4
2 parents 278e4ac + caf125d commit 76a7738

58 files changed

Lines changed: 2605 additions & 266 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coveragerc

Lines changed: 0 additions & 10 deletions
This file was deleted.

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,11 @@ docs/_build/
5555

5656
# PyBuilder
5757
target/
58+
59+
.idea/*
60+
.eggs/*
61+
.sync
62+
syncano.yml
63+
scripts
64+
*.iml
65+

.isort.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[settings]
2+
line_length=120
3+
multi_line_output=3
4+
default_section=THIRDPARTY
5+
skip=.eggs,egg-info

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
include README.md
1+
include README.rst
22
include LICENSE

README.md

Lines changed: 0 additions & 48 deletions
This file was deleted.

README.rst

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
Syncano command line tool
2+
=========================
3+
4+
Installation
5+
------------
6+
7+
::
8+
9+
pip install syncano-cli
10+
11+
Usage
12+
-----
13+
14+
First you need to login into your account
15+
16+
::
17+
18+
syncano login
19+
20+
It will ask you for your email and password and store account key in
21+
${HOME}/.syncano file. You can also override account key with --key option.
22+
23+
Pulling your instance classes and scripts
24+
-----------------------------------------
25+
26+
In order to pull your instance configuration you can execute
27+
28+
::
29+
30+
syncano sync pull <instance_name>
31+
32+
This will fetch all Classes and Scripts into current working directory, and
33+
store configuration in syncano.yml file. If you want to pull only selected
34+
classes/scripts you can add -c/--class or -s/--script option eg.
35+
36+
::
37+
38+
syncano sync pull -c Class1 -c Class2 -s script_label_1 -s "script label 2" my_instance
39+
40+
Scripts source code is stored in scripts subdirectory, and names are based on
41+
script labels. Keep in mind that script labels in syncano are not unique, and
42+
this tools can't handle this kind of situation.
43+
44+
Classes and Scripts configuration is stored in syncano.yml file. If file
45+
syncano.yml already exists only classes and scripts stored in this file, will
46+
be pulled and updated. If you want to pull whole instance you can use -a/--all
47+
flag.
48+
49+
Pushing your changes
50+
--------------------
51+
52+
When you have made some changes to syncano.yml or some script source code you
53+
can push the changes to syncano using
54+
55+
::
56+
57+
syncano sync push <instance_name>
58+
59+
It will push only changes newer then last synchronization time. This time is
60+
recorded using .sync file last modification time. If syncano.yml has changed
61+
it will try to push all data to syncano. Otherwise it will just push changed
62+
source code files for scripts. If you want to force push all changes you can
63+
use -a/--all option.
64+
65+
If you want to just push selected classes/scripts changes you can provide them
66+
with -c/--class or -s/--script options like in the pull example above.
67+
68+
Synchronization of changes in realtime
69+
--------------------------------------
70+
71+
There is also an option to synchronize your project live. When you change
72+
syncano.yml or some script source code pointed to by syncano.yml your changes
73+
will be automatically pushed to syncano.
74+
75+
::
76+
77+
syncano sync watch
78+
79+
This command will push all your project configuration to syncano and will
80+
wait for changes made to project files. When it detects file modification
81+
it will push those changes to syncano.
82+
83+
84+
Syncano Parse migration tool
85+
============================
86+
87+
This tool will help you to move your data from Parse to Syncano.
88+
89+
Usage
90+
-----
91+
92+
Currently supports only transferring data. This tool takes the Parse schemas and transform them to Syncano classes.
93+
Next step is to move all of the data between Parse and Syncano. The last step is rebuilding the relations between
94+
objects.
95+
96+
97+
Configuration
98+
-------------
99+
100+
::
101+
102+
syncano migrate configure
103+
104+
Will run the configuration that will ask you for the following variables:
105+
106+
* PARSE_MASTER_KEY: the master key of your PARSE account;
107+
* PARSE_APPLICATION_ID: the application ID of the application that you want to transfer;
108+
* SYNCANO_ADMIN_API_KEY: Syncano Account Key;
109+
* SYNCANO_INSTANCE_NAME: the Syncano instance name to which the transfer will be made;
110+
111+
`syncano migrate configure` command will take following parameters:
112+
113+
* -c (--current) which will display the current configuration;
114+
* -f (--force) which allow to override the previously set configuration;
115+
116+
The configuration will be stored in your home directory in .syncano file under the P2S section.
117+
It's used to call the Parse API and Syncano API as well.
118+
119+
Run migration
120+
------------
121+
122+
::
123+
124+
syncano migrate parse
125+
126+
This command will run the synchronization process between Parse and Syncano. Sit comfortably in your chair and read
127+
the output.
128+
129+
Syncano Hosting
130+
---------------
131+
132+
Syncano Hosting is a simple way to host the static files. CLI supports it in the following way:
133+
134+
::
135+
136+
syncano hosting <instance_name> --list-files
137+
138+
This command will list files in hosting which match the default hosting.
139+
140+
::
141+
142+
syncano hosting <instance_name> --publish <base_dir>
143+
144+
This command will publish all files inside <base_dir> and will publish it to the Syncano Hosting (default one).
145+
The whole directory structure - will be mapped in Syncano Hosting.
146+
147+
148+
Tips & Troubleshooting
149+
----------------------
150+
151+
1. This tool currently does not support checking if some object is already present in the Syncano instance,
152+
so if sync is run twice the end results is that data is duplicated. To avoid such cases,
153+
simply remove your instance in using Syncano dashboard;
154+
155+
2. The process can be quite slow - it's because of the throttling on both sides: Parse and Syncano on free accounts
156+
(which is the bottom boundary for scripts);
157+
158+
3. If you encounter any problems, have some improvements proposal or just wanna talk,
159+
please write me: sebastian.opalczynski@syncano.com;
160+
161+
4. The Syncano can be found on - please do not hesitate to ask for help or share your thoughts;
162+
163+
* Github:
164+
* https://github.com/Syncano/
165+
* Gitter:
166+
* https://gitter.im/Syncano/community
167+
* https://gitter.im/Syncano/community-pl
168+
* Slack:
169+
* http://syncano-community.github.io/slack-invite/
170+
171+
172+
Running scripts
173+
===============
174+
175+
This command will allow you to execute any script (Script Endpoint) with optional payload and read the output.
176+
177+
Usage:
178+
179+
::
180+
181+
syncano execute <instance_name> <script_endpoint_name> --payload="<payload_in_JSON_format>"

circle.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ machine:
55
dependencies:
66
pre:
77
- pip install -U setuptools
8-
- pip install -U flake8
9-
- pip install -U isort
108

119
test:
1210
override:
13-
- python setup.py flake8
11+
- pip install -r requirements-tests.txt
12+
- flake8 .
1413
- isort --recursive --check-only .
1514
- python setup.py test
1615

0 commit comments

Comments
 (0)