@@ -167,40 +167,44 @@ Once this has finished building, you can run the image like so from the root of
167
167
the code you are trying to use Copybara on:
168
168
169
169
``` sh
170
- docker run -it -v " $( pwd) " :/usr/src/app copybara copybara
170
+ docker run -it -v " $( pwd) " :/usr/src/app copybara help
171
171
```
172
172
173
- A few environment variables exist to allow you to change how you run copybara:
174
- * ` COPYBARA_CONFIG=copy.bara.sky `
175
- * allows you to specify a path to a config file, defaults to root ` copy.bara.sky `
173
+ #### Environment variables
174
+
175
+ In addition to passing cmd args to the container, you can also set the following
176
+ environment variables as an alternative:
176
177
* ` COPYBARA_SUBCOMMAND=migrate `
177
178
* allows you to change the command run, defaults to ` migrate `
178
- * ` COPYBARA_OPTIONS='' `
179
- * allows you to specify options for copybara , defaults to none
179
+ * ` COPYBARA_CONFIG=copy.bara.sky `
180
+ * allows you to specify a path to a config file , defaults to root ` copy.bara.sky `
180
181
* ` COPYBARA_WORKFLOW=default `
181
182
* allows you to specify the workflow to run, defaults to ` default `
182
183
* ` COPYBARA_SOURCEREF='' `
183
184
* allows you to specify the sourceref, defaults to none
185
+ * ` COPYBARA_OPTIONS='' `
186
+ * allows you to specify options for copybara, defaults to none
184
187
185
188
``` sh
186
189
docker run \
187
- -e COPYBARA_CONFIG=' other.config.sky' \
188
190
-e COPYBARA_SUBCOMMAND=' validate' \
191
+ -e COPYBARA_CONFIG=' other.config.sky' \
189
192
-v " $( pwd) " :/usr/src/app \
190
- -it copybara copybara
193
+ -it copybara
191
194
```
192
195
193
196
#### Git Config and Credentials
194
197
195
198
There are a number of ways by which to share your git config and ssh credentials
196
- with the Docker container, an example with macOS is below:
199
+ with the Docker container, an example is below:
197
200
198
201
``` sh
199
202
docker run \
203
+ -v ~ /.gitconfig:/root/.gitconfig:ro \
200
204
-v ~ /.ssh:/root/.ssh \
201
- -v ~ /.gitconfig:/root/.gitconfig \
205
+ -v ${SSH_AUTH_SOCK} : ${SSH_AUTH_SOCK} -e SSH_AUTH_SOCK
202
206
-v " $( pwd) " :/usr/src/app \
203
- -it copybara copybara
207
+ -it copybara
204
208
```
205
209
206
210
## Documentation
0 commit comments