work flow for solo developers and small teams

Post on 08-May-2015

3.280 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

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 at: http://designtotheme.com/workshops/work-flow-solo-developers-and-small-teams

TRANSCRIPT

Work Flow forSolo Developers and Small Teams

@emmajanedotnetemma@emmajane.net

Today

1. Developer’s Environment(The Command Line)

2. Version Control Basics

3.Developer Tools for Larger Teams

A Developer’s Environment

Together, Yet Separate

The command line is used in many free,online resources.

GUIs reveal complexity in different ways.

SourceTree, OSX

SmartGit, cross-platform

$ _

In the Beginning, Was the Command LineA 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

Commands Affect Your Environment

http://en.wikipedia.org/wiki/Logo_(programming_language)

Commands Affect Your Environment

http://www.youtube.com/watch?v=LRhbcDzbGSU

Command Line Interface

http://en.wikipedia.org/wiki/Command_Prompt

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?”

Commands(verb)

● One-word actions:– sing– jump– look

● One-word commands:– help– exit– history

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

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

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

“All” The Commands

http://www.commandlinefu.com/commands/browseThis site includes a “rating” function.

Learning the CLI toolsmakes 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.

Version Control Basics

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

There is no excusefor not having version control.

The cheapest way to get version control is to use an automated backup system, like Dropbox, for your code.

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.

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.

Workflow: The Solo Developer

Create project Add files Do your work

Do more work

Upload files

define:workBasic Check-ins

Milk MilkEggs

MilkEggsJuice

MilkEggsSoup

MilkEggs

r1 r2 r3 r4

Main Trunk

Diffs Show the DifferenceBetween Two Versions of a Project

Milk MilkEggs

MilkEggsJuice

MilkEggsSoup

MilkEggs

r1 r2 r3 r4

Main Trunk

+ Eggs + Juice - Juice+ Soup

define:workTagging

MilkEggsSoup

MilkEggsSoupBread

MilkEggsSoupBreadM&Ms

r4 r7 r9

Main Trunk

James’s FinalGrocery List

Emma’sAdditions

GroceriesPurchased

define:workBranching

MilkEggsSoup

MilkEggsSoupBread

MilkEggsSoupBreadM&Ms

r4 r7

r9

Main Trunk

Candy Store

Workflow: Read-only Projects“Fork Me” on GitHub

Improvedversion of

project

Random Project on the Internet

My Fork

(branch)

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.

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.

Merging

MilkEggsSoup

MilkEggsSoupBread

MilkEggsSoupM&Ms

Main Trunk (James’s List)

+ Bread

MilkEggsSoup

+ M&Ms

+ M&Ms

MilkEggsSoupBreadM&Ms

Resolving Conflicts

MilkEggsSoup

MilkEggsBread

MilkEggsSoupM&Ms

Main Trunk (James’s List)

+ Bread- Soup

MilkEggsSoup

+ M&Ms

+ M&Ms

MilkEggsBreadM&Ms+ Bread

Sample Project

http://betterexplained.com/articles/a-visual-guide-to-version-control/

Workflow: Centralizedno local commits

checkout

commit

Workflow:Decentralized with a shared mainline

clone (or) pull

push

commit

commit

Developer Tools for Larger Teams

Complicated problems are complicated.

● Bigger code base = more contributors -> formalized code review process

● Bigger projects = more stakeholders -> project management

● Bigger projects = more infrastructure -> devops

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.

Workflow:Decentralized with human gatekeeper

clone

request merge

commit

commit

reject changes

merge changespull (fo

r updates)

Workflow:Decentralized with automated gatekeeper

clone

merge request

commit

commit

reject failed patches

push

pull (for updates)

requ

est r

evie

w

Project Management

● software– Trac, Basecamp, JIRA, (etc, etc)

● philosophies– Waterfall, Agile (XP, Scrum, Kanban)

* 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.

DevOps

Developers + Operations (System Administrators)

● Culture● Automation● Measurement● Sharing

DevOps Tools

● Deployment automation– fai, kickstart, preseed, cobbler

● Configuration management– puppet, chef, cfengine, bcfg2

● Build automation– jenkins, hudson, maven, ant, cruisecontrol

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.

Let’s Keep In Touch

● emma@designtotheme.com● @emmajanedotnet

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

top related