Team Workflows - jvPalma/dotrun GitHub Wiki
Team Workflows
β Script Development | Home | Configuration Management β
Table of Contents
- Team Collaboration Overview
- Collections Management
- Sharing Strategies
- Version Control
- Team Standards
- Conflict Resolution
- Best Practices
- Next Steps
π₯ Team Setup Guide
First time setting up DotRun for your team? Follow this path:
Installation β User Guide β Script Development β Team Workflows
See Script Examples for ready-to-share team scripts
Team Collaboration Overview
DotRun enables teams to share scripts while maintaining personal customizations:
Key Concepts
- Personal Workspace:
~/.config/dotrun/- Your local scripts - Collections: Shareable script bundles
- Categories: Organizational structure
- Git Integration: Version control for all scripts
Collaboration Model
Team Repository Personal Workspace
βββββββββββββββ ββββββββββββββββββββ
β Shared β import β ~/.config/dotrun β
β Collections ββββββββββΆβ βββ bin/ β
β β β βββ collections/ β
βββββββββββββββ β βββ docs/ β
ββββββββββββββββββββ
Collections Management
Creating Collections
Package scripts for team sharing:
# Create a collection from a category
dr collection create git-tools --category git/
# Create from specific scripts
dr collection create deploy-scripts \
deploy/staging \
deploy/production \
deploy/rollback
# Create with documentation
dr collection create dev-toolkit \
--category dev/ \
--docs dev-toolkit.md
Collection Structure
git-tools-collection/
βββ manifest.json
βββ scripts/
β βββ branch-cleanup
β βββ quick-commit
β βββ pr-create
βββ docs/
β βββ git-tools.md
βββ README.md
Exporting Collections
# Export to file
dr collection export git-tools ~/shared/git-tools.tar.gz
# Export with dependencies
dr collection export dev-tools ~/dev-tools.tar.gz --include-deps
# Export with metadata
dr collection export deploy-kit ~/deploy-kit.tar.gz \
--author "Team Name" \
--version "1.0.0"
Importing Collections
# Import a collection
dr collection import ~/shared/git-tools.tar.gz
# Import with prefix (avoid conflicts)
dr collection import ~/utils.tar.gz --prefix team-
# Preview before importing
dr collection import ~/new-tools.tar.gz --dry-run
Managing Collections
# List installed collections
dr collection list
# Show collection details
dr collection info git-tools
# Update a collection
dr collection update git-tools ~/git-tools-v2.tar.gz
# Remove a collection
dr collection remove git-tools
Sharing Strategies
1. Centralized Repository
Create a team repository for shared scripts:
# Team repository structure
team-dotrun/
βββ collections/
β βββ git-tools.tar.gz
β βββ deploy-scripts.tar.gz
β βββ dev-utils.tar.gz
βββ docs/
β βββ team-standards.md
βββ install-team.sh
βββ README.md
Team installation script:
#!/usr/bin/env bash
# install-team.sh
# Install DotRun if needed
if ! command -v dr &>/dev/null; then
bash <(curl -fsSL https://raw.githubusercontent.com/jvPalma/dotrun/master/install.sh)
fi
# Import team collections
for collection in collections/*.tar.gz; do
echo "Importing $(basename "$collection")..."
dr collection import "$collection"
done
echo "Team scripts installed!"
2. Git Submodules
Use Git submodules for script sharing:
# In team repository
cd ~/.config/dotrun
git submodule add https://github.com/team/shared-scripts shared
# Link shared scripts
ln -s shared/git/* bin/git/
3. Direct Git Integration
Share the entire DotRun workspace:
# Initialize team repository
cd ~/.config/dotrun
git remote add team https://github.com/team/dotrun-scripts
git fetch team
git checkout -b team-scripts team/main
# Merge team scripts
git checkout main
git merge team-scripts --allow-unrelated-histories
Version Control
Git Workflow
# Initial setup
cd ~/.config/dotrun
git init
git add .
git commit -m "Initial DotRun setup"
# Add team remote
git remote add team https://github.com/team/dotrun-scripts
# Create branches for different contexts
git checkout -b personal
git checkout -b team-shared
Commit Conventions
Use clear commit messages:
# Good commit messages
git commit -m "Add: git/branch-cleanup script for removing merged branches"
git commit -m "Fix: deploy/staging - correct environment variable"
git commit -m "Update: docker/build - add multi-arch support"
git commit -m "Docs: Add troubleshooting section to deploy scripts"
Syncing Changes
# Pull team updates
git fetch team
git merge team/main
# Push personal scripts to team
git checkout team-shared
git cherry-pick <commit-hash>
git push team team-shared:feature/new-script
Team Standards
Naming Conventions
Establish consistent naming:
Category/
βββ verb-noun # Actions: build-image, deploy-app
βββ noun-verb # Resources: server-restart, db-backup
βββ feature-action # Features: auth-setup, cache-clear
Documentation Requirements
Enforce documentation standards:
### DOC
# Script: category/script-name
# Author: Team Member Name
# Date: 2024-01-01
# Version: 1.0.0
#
# Description:
# What this script does and why it exists
#
# Team Notes:
# - Requires VPN connection
# - Uses shared credentials from vault
#
# [Rest of standard documentation]
### DOC
Code Review Process
# Create review branch
git checkout -b review/new-deploy-script
# Add script
dr set deploy/new-feature
# Push for review
git push origin review/new-deploy-script
# After approval, merge to team branch
git checkout team-shared
git merge review/new-deploy-script
Conflict Resolution
Handling Name Conflicts
When importing collections with conflicting names:
# Option 1: Use prefix
dr collection import tools.tar.gz --prefix external-
# Option 2: Skip conflicts
dr collection import tools.tar.gz --skip-existing
# Option 3: Force overwrite (careful!)
dr collection import tools.tar.gz --force
Merging Changes
Handle Git conflicts in scripts:
# See conflicts
git status
# Edit conflicted script
dr set deploy/staging
# Resolve and commit
git add bin/deploy/staging
git commit -m "Merge: Resolve staging deploy conflicts"
Version Management
Track script versions:
# In script header
### DOC
# Version: 2.1.0
# Changelog:
# 2.1.0 - Add multi-region support
# 2.0.0 - Breaking change: new config format
# 1.0.0 - Initial version
### DOC
Best Practices
1. Clear Ownership
Define script ownership:
# In script documentation
### DOC
# Maintainer: @teamember
# Team: Platform Team
# Slack: #platform-support
### DOC
2. Testing Requirements
Establish testing standards:
# Test before sharing
./test/run-all-tests.sh
# Include tests with collections
dr collection create tools --include-tests
3. Security Guidelines
- Never commit credentials
- Use environment variables
- Document required permissions
- Review scripts before importing
4. Communication
# Add team notifications
cat >>~/.config/dotrun/bin/deploy/production <<'EOF'
# Notify team
slack-notify "#deployments" "Production deploy started by $(whoami)"
EOF
5. Documentation
Maintain team documentation:
# Create team guide
dr doc create team-onboarding
# Document shared utilities
dr doc create shared-libraries
# Keep changelog
dr doc create changelog
Next Steps
Now that you understand team workflows:
- Set Up Configuration: Learn Configuration Management
- Manage Documentation: Explore Documentation System
- Implement Standards: Review Script Development
- Handle Aliases: Set up Alias Management
- See Examples: Check Team Examples
β Script Development | Configuration Management β | Top β