-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.sh
executable file
·172 lines (120 loc) · 3.69 KB
/
README.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#!/bin/sh
echo "Readme generation started."
FILE='README.md'
FAKE_API_TOKEN='broker_api_token'
FAKE_DS_USERNAME='broker_ds_username'
FAKE_DS_PASSWORD='broker_ds_password'
cat > $FILE <<- EOM
# procedure_tools
## Install
1. Clone
\`\`\`
git clone https://github.com/ProzorroUKR/procedure_tools.git
\`\`\`
2. Navigate to cloned folder:
\`\`\`
cd procedure_tools
\`\`\`
3. Install with pip
* vanilla:
\`\`\`
pip install -e .
\`\`\`
* colorized output:
\`\`\`
pip install -e .[color]
\`\`\`
## Update
1. Pull
\`\`\`
git pull
\`\`\`
In case of conflicts:
* Undo changes in project folder or reset with command
\`\`\`
git reset --hard
\`\`\`
* Pull again
\`\`\`
git pull
\`\`\`
* If this did not help, clean project folder
\`\`\`
git clean -fd
\`\`\`
* Pull again
\`\`\`
git pull
\`\`\`
2. Install
\`\`\`
pip install -e .
\`\`\`
## Usage
\`\`\`
EOM
echo "Executing command help."
procedure -h >> $FILE
echo "Command help successfully generated."
cat >> $FILE <<- EOM
\`\`\`
## Usage example
Create with default data
\`\`\`
procedure ${API_HOST} ${FAKE_API_TOKEN} ${DS_HOST} ${FAKE_DS_USERNAME} ${FAKE_DS_PASSWORD} --acceleration=1000000 --path=/api/0/ --data=closeFrameworkAgreementUA
\`\`\`
Create with default data and stop after specific data file
\`\`\`
procedure ${API_HOST} ${FAKE_API_TOKEN} ${DS_HOST} ${FAKE_DS_USERNAME} ${FAKE_DS_PASSWORD} --acceleration=1000000 --path=/api/0/ --data=closeFrameworkAgreementUA --stop=bid_create_3.json
\`\`\`
Create with custom data files (relative path)
\`\`\`
procedure ${API_HOST} ${FAKE_API_TOKEN} ${DS_HOST} ${FAKE_DS_USERNAME} ${FAKE_DS_PASSWORD} --acceleration=1000000 --path=/api/0/ --data=customdata/closeFrameworkAgreementUA
\`\`\`
Create with custom data files (absolute path)
\`\`\`
procedure ${API_HOST} ${FAKE_API_TOKEN} ${DS_HOST} ${FAKE_DS_USERNAME} ${FAKE_DS_PASSWORD} --acceleration=1000000 --path=/api/0/ --data=/Users/JonhDoe/customdata/closeFrameworkAgreementUA
\`\`\`
Create with custom data files (absolute path, Windows)
\`\`\`
procedure ${API_HOST} ${FAKE_API_TOKEN} ${DS_HOST} ${FAKE_DS_USERNAME} ${FAKE_DS_PASSWORD} --acceleration=1000000 --path=/api/0/ --data=C:\Users\JonhDoe\customdata\closeFrameworkAgreementUA
\`\`\`
## Output example
\`\`\`
procedure ${API_HOST} ${FAKE_API_TOKEN} ${DS_HOST} ${FAKE_DS_USERNAME} ${FAKE_DS_PASSWORD} --acceleration=1000000 --path=/api/0/ --data=closeFrameworkAgreementUA --stop=bid_create_4.json
\`\`\`
\`\`\`
EOM
echo "Executing command example."
procedure ${API_HOST} ${API_TOKEN} ${DS_HOST} ${DS_USERNAME} ${DS_PASSWORD} --acceleration=1000000 --path=/api/0/ --data=closeFrameworkAgreementUA --stop=bid_create_3.json >> $FILE
echo "Command example successfully generated."
cat >> $FILE <<- EOM
\`\`\`
## Update readme
\`\`\`
export API_HOST=${API_HOST}
export API_TOKEN=${FAKE_API_TOKEN}
export DS_HOST=${DS_HOST}
export DS_USERNAME=${FAKE_DS_USERNAME}
export DS_PASSWORD=${FAKE_DS_PASSWORD}
./README.sh
\`\`\`
or
\`\`\`
API_HOST=${API_HOST} API_TOKEN=${FAKE_API_TOKEN} DS_HOST=${DS_HOST} DS_USERNAME=${FAKE_DS_USERNAME} DS_PASSWORD=${FAKE_DS_PASSWORD} ./README.sh
\`\`\`
## Run tests
\`\`\`
export API_HOST=${API_HOST}
export API_TOKEN=${FAKE_API_TOKEN}
export DS_HOST=${DS_HOST}
export DS_USERNAME=${FAKE_DS_USERNAME}
export DS_PASSWORD=${FAKE_DS_PASSWORD}
python setup.py test
\`\`\`
or
\`\`\`
API_HOST=${API_HOST} API_TOKEN=${FAKE_API_TOKEN} DS_HOST=${DS_HOST} DS_USERNAME=${FAKE_DS_USERNAME} DS_PASSWORD=${FAKE_DS_PASSWORD} python setup.py test
\`\`\`
EOM
echo "Readme successfully generated."