X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/406b3de5426bf0d63564410cf6caf2834ba2b7bb..5ff4dac7a9ee28eb35a796b80421a6d3d1e5ecd0:/doc/user/tutorials/git-arvados-guide.html.textile.liquid diff --git a/doc/user/tutorials/git-arvados-guide.html.textile.liquid b/doc/user/tutorials/git-arvados-guide.html.textile.liquid index cabe43deb4..2e255219d2 100644 --- a/doc/user/tutorials/git-arvados-guide.html.textile.liquid +++ b/doc/user/tutorials/git-arvados-guide.html.textile.liquid @@ -3,6 +3,11 @@ layout: default navsection: userguide title: Working with an Arvados git repository ... +{% comment %} +Copyright (C) The Arvados Authors. All rights reserved. + +SPDX-License-Identifier: CC-BY-SA-3.0 +{% endcomment %} This tutorial describes how to work with a new Arvados git repository. Working with an Arvados git repository is analogous to working with other public git repositories. It will show you how to upload custom scripts to a remote Arvados repository, so you can use it in Arvados pipelines. @@ -50,40 +55,51 @@ Ignore any warning that you are cloning an empty repository. h2. Creating a git branch in an Arvados repository +Create a git branch named *tutorial_branch* in the *tutorial* Arvados git repository. +
~$ cd tutorial
-~$ git checkout -b tutorial_branch
+~/tutorial$ git checkout -b tutorial_branch
 
-h2. Adding files or scripts to an Arvados repository +h2. Adding scripts to an Arvados repository -Create a file named *tutorial.txt* in the local repository. +Arvados crunch scripts need to be added in a *crunch_scripts* subdirectory in the repository. If this subdirectory does not exist, first create it in the local repository and change to that directory: -
~$ echo 'hello world' > tutorial.txt
-
+
~/tutorial$ mkdir crunch_scripts
+~/tutorial$ cd crunch_scripts
-Next, add the new file to the git index. +Next, using @nano@ or your favorite Unix text editor, create a new file called @hash.py@ in the @crunch_scripts@ directory. - -
~$ git add tutorial.txt
-
-
+notextile.
~/tutorial/crunch_scripts$ nano hash.py
+ +Add the following code to compute the MD5 hash of each file in a collection + + {% code 'tutorial_hash_script_py' as python %} + +Make the file executable: + +notextile.
~/tutorial/crunch_scripts$ chmod +x hash.py
+ +Next, add the file to the git repository. This tells @git@ that the file should be included on the next commit. + +notextile.
~/tutorial/crunch_scripts$ git add hash.py
-Next, commit all the changes to the local repository, along with a commit message tht describes what this script does. +Next, commit your changes. All staged changes are recorded into the local git repository: -
~$ git commit -a -m "Added tutorial.txt"
+
~/tutorial/crunch_scripts$ git commit -m "my first script"
 
-Next, push the changes in the local repository to the remote repository. +Finally, upload your changes to the remote repository: -
~$ git push origin tutorial_branch
+
~/tutorial/crunch_scripts$ git push origin tutorial_branch
 
-Although this tutorial showed how to add a text file to Arvados, this tutorial should also show the necessary steps for adding your custom bash, R, or python scripts to an Arvados repository. +Although this tutorial shows how to add a python script to Arvados, the same steps can be used to add any of your custom bash, R, or python scripts to an Arvados repository.