Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Work Flow for Solo Developers and Small Teams

Work Flow for Solo Developers and Small Teams

Is your theme folder filled with files like this: page.old.2.bak.php? Does Git make you angry inside? Do you resent that everyone except you regularly visits the magical place referred to as "The Command Line"? Are you afraid of the vagrant who stole your puppet? In this workshop you will get a step-by-step introduction to working efficiently as a Drupal developer in small teams, or as a solo developer. We'll focus on real world examples you can actually use to make your work faster and more efficient.

Full workshop available. For more details, visit: http://designtotheme.com/workshops/work-flow-solo-developers-and-small-teams

Emma Jane Hogbin Westby

November 14, 2012
Tweet

More Decks by Emma Jane Hogbin Westby

Other Decks in Technology

Transcript

  1. $ _

  2. In the Beginning, Was the Command Line A command-line interface

    (CLI) is a means of interaction with a computer program where the user (or client) issues commands to a program in the form of successive lines of text (command lines). The command-line interface evolved from a form of dialog once conducted by humans over teleprinter machines, in which human operators remotely exchanged information, usually one line of text at a time. http://en.wikipedia.org/wiki/Command-line_interface
  3. define:prompt a transitive verb meaning To move to action. ?

    forward 90 > open mailbox At the command line, you are constantly being asked by the computer, “What action would you like to take next?”
  4. Commands (verb) • One-word actions: – sing – jump –

    look • One-word commands: – help – exit – history
  5. Commands With Parameters (verb noun) • An action, and a

    direct object: – take book – read pamphlet – open window • Commands with parameters: – cd /var/www – man <command_name> – mv file_current_name.jpg file_new_name.jpg
  6. Commands With Modifiers + Parameters (verb adjective noun) • Refining

    the request: – go down stairs – take blue pill – open left door • Adding a flag/switch/modifier: – mkdir -p parent_directory/sub-directory – tar xvf file_to_extract.tar.gz – ls -lh
  7. Ten Commands I Use All the Time ls list files

    cd change the current directory mv move a file to a new location (and/or rename) cp copy a file pwd print working directory (answers: where am I?) rm remove file clear refresh the screen man read the manual page for a specific command tar work with packages of files chmod change the “mode” (aka permissions) of a file or directory
  8. Learning the CLI tools makes your knowledge portable. • OSX

    and Linux both use the same flavour of command line environment (“the shell”). • Not all Web server applications have a graphical administrative interface, so learning to use the command line allows you to run server applications in your local developer environment. • Sequences of commands can be captured as scripts, which you can run on any compatible machine without having to point-and-click.
  9. Benefits of Version Control • Backup and restore • Syncronization

    across multiple systems • Short-term undo to test implications • Long-term undo to reverse bugs • Track changes to see why/how software evolved • Track ownership to give ‘credit’ to change makers • Sandboxing our code to test changes without affecting others
  10. There is no excuse for not having version control. The

    cheapest way to get version control is to use an automated backup system, like Dropbox, for your code.
  11. Terminology • Repository. The database of changes to your files.

    • Server. The computer storing the repository. • Client. The computer connecting to the repository. • Working copy. Your local copy, where changes are made. • Trunk (or “main”). The current, primary source for unchanged code. • Head. The latest revision in the repository.
  12. Basic Actions • Add. Put a file into the repo.

    • Revision. Checks what version a file is on. • Check out. Download files from the main repository. • Check in. Upload changed files to the main repository. • Changelog. A list of changes made to a file since it was created. • Update/sync. Synchronize your files with the ones from the main repository. • Revert. Throw away your local changes and reload the latest version from the repository.
  13. define:work Basic Check-ins Milk Milk Eggs Milk Eggs Juice Milk

    Eggs Soup Milk Eggs r1 r2 r3 r4 Main Trunk
  14. Diffs Show the Difference Between Two Versions of a Project

    Milk Milk Eggs Milk Eggs Juice Milk Eggs Soup Milk Eggs r1 r2 r3 r4 Main Trunk + Eggs + Juice - Juice + Soup
  15. define:work Tagging Milk Eggs Soup Milk Eggs Soup Bread Milk

    Eggs Soup Bread M&Ms r4 r7 r9 Main Trunk James’s Final Grocery List Emma’s Additions Groceries Purchased
  16. define:work Branching Milk Eggs Soup Milk Eggs Soup Bread Milk

    Eggs Soup Bread M&Ms r4 r7 r9 Main Trunk Candy Store
  17. Workflow: Read-only Projects “Fork Me” on GitHub Improved version of

    project Random Project on the Internet My Fork (branch)
  18. Workflow: Partner 1. James starts a grocery list 2. Emma

    already had a grocery list started. She asks to see James’s list. 3. James remembers a couple more items. 5. The grocery lists are combined and James goes shopping. 4. Emma adds a few things from her list.
  19. Collaborative Actions • Branch. Create a separate copy of a

    repository for personal use. • Diff/change/delta. Identifies the differences between two versions of a file. • Merge/patch. Apply the changes from one version of a file, to another. • Conflict. When two versions of a file have proposed changes at the same place. • Resolve. Deciding which version of conflicting changes should be applied, and which should be discarded.
  20. Merging Milk Eggs Soup Milk Eggs Soup Bread Milk Eggs

    Soup M&Ms Main Trunk (James’s List) + Bread Milk Eggs Soup + M&Ms + M&Ms Milk Eggs Soup Bread M&Ms
  21. Resolving Conflicts Milk Eggs Soup Milk Eggs Bread Milk Eggs

    Soup M&Ms Main Trunk (James’s List) + Bread - Soup Milk Eggs Soup + M&Ms + M&Ms Milk Eggs Bread M&Ms + Bread
  22. Complicated problems are complicated. • Bigger code base = more

    contributors -> formalized code review process • Bigger projects = more stakeholders -> project management • Bigger projects = more infrastructure -> devops
  23. Formal Code Review Process • Code should never be released

    into the wild without having a second set of eyes on it. • It’s very easy to overengineer your workflow process. • Make sure you do what’s right, not what’s easy, for your team.
  24. Workflow: Decentralized with automated gatekeeper clone merge request commit commit

    reject failed patches push pull (for updates) request review
  25. Project Management • software – Trac, Basecamp, JIRA, (etc, etc)

    • philosophies – Waterfall, Agile (XP, Scrum, Kanban)
  26. * Driven Development • Test-driven development (TDD) Write an (initially

    failing) automated test case that defines a desired improvement or new function, then produces the minimum amount of code to pass that test, and finally refactors the new code to acceptable standards. • Behaviour-driven development (BDD) Behaviour-driven development specifies that tests of any unit of software should be specified in terms of the desired behaviour of the unit.
  27. DevOps Tools • Deployment automation – fai, kickstart, preseed, cobbler

    • Configuration management – puppet, chef, cfengine, bcfg2 • Build automation – jenkins, hudson, maven, ant, cruisecontrol
  28. Start Today, Refine Later Today. • Don’t try to change

    everything at once. • Look for easy things to change and implement little bits at a time. • Sometimes you need to have short term inefficiencies (learning a new tool) to gain long term productivity. • Don’t let the enemy of progress be perfection.
  29. Credits • Type face: – Neutra Text by House Industries.

    • Icons: – “Gartoon” icon theme pack for GNOME from http://art.gnome.org/themes/icon – http://openclipart.org/user-detail/yyycatch • Diagram ideas: – http://betterexplained.com/articles/a-visual-guide-to-version-control/ – http://wiki.bazaar.canonical.com/Workflows