Skip to content

Commit

Permalink
Merge pull request #571 from JrGoodle/yaml
Browse files Browse the repository at this point in the history
Fix clowder yaml command
  • Loading branch information
JrGoodle committed Jun 17, 2020
2 parents f039130 + 37b603c commit 475c40c
Show file tree
Hide file tree
Showing 11 changed files with 259 additions and 68 deletions.
6 changes: 3 additions & 3 deletions docs/clowder-repo.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# The Clowder Repo

The "clowder repo" is a git repository cloned into the `.clowder` directory when the `clowder init` command is run
The "clowder repo" is a git repository cloned into the `.clowder` directory when the `clowder init` command is run.

## Default `clowder.yml`

At the root is the primary `clowder.yml` that is symlinked by default during `clowder init`. This file can be symlinked later be running `clowder link`
At the root is the default `clowder.yml` file that is symlinked during `clowder init`. This file can be symlinked later be running `clowder link`.

## Versions

A `versions` directory can contain versioned `<version>.clowder.yml` files. These can be symlinked with the `clowder link <version>` command
A `versions` directory can contain versioned `<version>.clowder.yml` files. These can be symlinked with the `clowder link <version>` command.

For example, `versions/my_version.clowder.yml` would by symlinked by running `clowder link my_version`
114 changes: 71 additions & 43 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ Examples based on the [Swift projects clowder.yml](https://github.com/JrGoodle/s
* [clowder repo](#clowder-repo)
* [clowder save](#clowder-save)
* [other commands](#other-commands)
* [clowder config](#clowder-config)
* [clowder config](#clowder-config-EXPERIMENTAL)
* [clowder config get](#clowder-config-get-EXPERIMENTAL)
* [clowder config set](#clowder-config-set-EXPERIMENTAL)
* [clowder config clear](#clowder-config-clear-EXPERIMENTAL)
* [clowder yaml](#clowder-yaml)

## main commands
Expand Down Expand Up @@ -55,11 +58,11 @@ clowder herd -b my_branch
# Herd a specified tag if it exists, otherwise use default ref
clowder herd -t my_tag

# Only herd projects in swift and llvm groups
clowder herd swift llvm
# Herd all projects
clowder herd all linux

# Only herd swift project
clowder herd apple/swift
clowder herd swift
```

### clowder status
Expand Down Expand Up @@ -91,17 +94,17 @@ clowder forall -ic "git status"
# Run script in all project directories, ignoring errors
clowder forall -ic "/path/to/script.sh"

# Run command for projects in llvm group
clowder forall -c "git status" -g llvm
# Run command for all projects
clowder forall all linux -c "git status"

# Run script for projects in llvm group
clowder forall -c "/path/to/script.sh" -g llvm
# Run script for all projects
clowder forall all linux -c "/path/to/script.sh"

# Run command for swift project
clowder forall apple/swift -c "git status"
clowder forall swift -c "git status"

# Run script for swift project
clowder forall apple/swift -c "/path/to/script.sh"
clowder forall swift -c "/path/to/script.sh"
```

The following environment variables are available for use in commands and scripts:
Expand Down Expand Up @@ -132,11 +135,11 @@ clowder branch -r
# Print all local and remote branches
clowder branch -a

# Print local branches in llvm group
clowder branch llvm
# Print local branches in llvm project
clowder branch swift

# Print local branches in swift project
clowder branch apple/swift
# Print local branches in all projects
clowder branch all linux
```

### clowder checkout
Expand All @@ -145,11 +148,11 @@ clowder branch apple/swift
# Checkout branches
clowder checkout branch_name

# Checkout branches in llvm group
clowder checkout branch_name llvm
# Checkout branches in all projects
clowder checkout branch_name all linux

# Checkout branches in swift project
clowder checkout branch_name apple/swift
clowder checkout branch_name swift
```

### clowder clean
Expand All @@ -170,11 +173,11 @@ clowder clean
# git submodule update --checkout --recursive --force
clowder clean -a

# Discard changes in projects in llvm group
clowder clean llvm
# Discard changes in all projects
clowder clean all linux

# Discard changes in swift project
clowder clean apple/swift
clowder clean swift

# Remove untracked directories in addition to untracked files
# Equivalent to:
Expand Down Expand Up @@ -213,11 +216,11 @@ Equivalent to running `git status -vv` in project directories
# Print git diff status for all projects
clowder diff

# Print git diff status for projects in llvm group
clowder diff llvm
# Print git diff status for all projects
clowder diff all linux

# Print git diff status for swift project
clowder diff apple/swift
clowder diff swift
```

### clowder prune
Expand All @@ -240,11 +243,11 @@ clowder prune -a stale_branch
# Force prune local and remote branch 'stale_branch' for all projects
clowder prune -af stale_branch

# Prune branch 'stale_branch' for projects in llvm group
clowder prune stale_branch llvm
# Prune branch 'stale_branch' for all projects
clowder prune stale_branch all linux

# Prune branch 'stale_branch' in swift project
clowder prune stale_branch apple/swift
clowder prune stale_branch swift
```

### clowder reset
Expand All @@ -256,13 +259,13 @@ Reset branches to upstream state
clowder reset

# Reset branches in all projects to closest timestamp to swift project
clowder reset --timestamp apple/swift
clowder reset --timestamp swift

# Reset branches in projects in llvm group
clowder reset llvm
# Reset branches in all projects
clowder reset all linux

# Reset branches in swift project
clowder reset apple/swift
clowder reset swift
```

### clowder start
Expand All @@ -276,11 +279,11 @@ clowder start my_feature
# Create new local and remote tracking branch 'my_feature' for all projects
clowder start -t my_feature

# Create new local branch 'my_feature' for projects in llvm group
clowder start my_feature llvm
# Create new local branch 'my_feature' for all projects
clowder start my_feature all linux

# Create new local branch 'my_feature' in swift project
clowder start my_feature apple/swift
clowder start my_feature swift
```

### clowder stash
Expand All @@ -291,11 +294,11 @@ Stash changes in dirty repositories
# Stash changes in all projects
clowder stash

# Stash changes in projects in llvm group
clowder stash llvm
# Stash changes in all projects
clowder stash all linux

# Stash changes in swift project
clowder stash apple/swift
clowder stash swift
```

## clowder repo commands
Expand All @@ -309,7 +312,7 @@ Set `clowder.yml` symlink
clowder link

# Point clowder.yml symlink to saved version
clowder link 0.1
clowder link swift-5.0-branch
```

### clowder repo
Expand Down Expand Up @@ -351,24 +354,49 @@ Save a `clowder.yml` version with the information from currently checked out rep
Versions are saved to `.clowder/<version_name>.clowder.yml`

```bash
# Save a version of clowder.yml with current commit sha's
clowder save 0.1
# Save swift-42.0.clowder.yml version with current commit sha's
clowder save swift-42.0
```

## other commands

### clowder config
### clowder config **_EXPERIMENTAL_**

#### clowder config get **_EXPERIMENTAL_**

TODO: Add content
```bash
# Print all set config values
clowder config get
```

#### clowder config set **_EXPERIMENTAL_**

```bash
# Set config values
clowder config set rebase
clowder config set jobs
clowder config set projects swift
clowder config set protocol ssh
```

#### clowder config clear **_EXPERIMENTAL_**

```bash
# Clear config values
clowder config clear rebase
clowder config clear jobs
clowder config clear projects
clowder config clear protocol
```

### clowder yaml

Print information about clowder.yml files

```bash
# Print clowder.yml file(s) referenced from current symlink and imports
# Print current clowder.yml file
clowder yaml

# Print resolved clowder.yml
# Print resolved clowder.yml with current commit sha's
clowder yaml -r
```
8 changes: 4 additions & 4 deletions docs/examples/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" || exit 1

export examples=( \
# 'init' \
'init' \
'herd' \
# 'status' \
'status' \
)

for example in "${examples[@]}"; do
terminalizer render $example -o "clowder-${example}.gif" || exit 1
# imageoptim --imagealpha "clowder-${example}.gif" || exit 1
imageoptim "clowder-${example}.gif" || exit 1
imageoptim --imagealpha "clowder-${example}.gif" || exit 1
# imageoptim "clowder-${example}.gif" || exit 1
done
34 changes: 34 additions & 0 deletions examples/cats/clowder-yaml-f.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

name: cats-default-test

defaults:
branch: master
remote: origin
source: github
protocol: https

sources:
- name: github
url: github.com

projects:
- name: jrgoodle/mu
path: mu
branch: knead
groups: [cats]
- name: jrgoodle/duke
path: duke
branch: purr
groups: [cats]
- name: jrgoodle/kit
path: black-cats/kit
groups: [black-cats]
- name: jrgoodle/kishka
path: black-cats/kishka
groups: [black-cats]
- name: jrgoodle/june
path: black-cats/june
groups: [black-cats]
- name: jrgoodle/sasha
path: black-cats/sasha
groups: [black-cats]
41 changes: 41 additions & 0 deletions examples/cats/clowder-yaml-r.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

defaults:
branch: master
protocol: https
remote: origin
source: github
name: cats-default-test
projects:
- commit: 43347045441d05c2dee745acf2a96f90643b8210
groups:
- cats
name: jrgoodle/duke
path: duke
- commit: 858cbea9bdef3809382681cf2b7c01817ca50b2d
groups:
- black-cats
name: jrgoodle/june
path: black-cats/june
- commit: 9777b550e4b586b71b33d5f703d8c37d2b477b1a
groups:
- black-cats
name: jrgoodle/kishka
path: black-cats/kishka
- commit: f2e20031ddce5cb097105f4d8ccbc77f4ac20709
groups:
- black-cats
name: jrgoodle/kit
path: black-cats/kit
- commit: 60044a0c5489872c1b793d9dbd8b3e4b19f66fb3
groups:
- cats
name: jrgoodle/mu
path: mu
- commit: b2c8e63d65aba4375b8ea5b84ad2a0e8487ec196
groups:
- black-cats
name: jrgoodle/sasha
path: black-cats/sasha
sources:
- name: github
url: github.com
37 changes: 37 additions & 0 deletions examples/cats/clowder-yaml.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

defaults:
branch: master
protocol: https
remote: origin
source: github
name: cats-default-test
projects:
- branch: purr
groups:
- cats
name: jrgoodle/duke
path: duke
- groups:
- black-cats
name: jrgoodle/june
path: black-cats/june
- groups:
- black-cats
name: jrgoodle/kishka
path: black-cats/kishka
- groups:
- black-cats
name: jrgoodle/kit
path: black-cats/kit
- branch: knead
groups:
- cats
name: jrgoodle/mu
path: mu
- groups:
- black-cats
name: jrgoodle/sasha
path: black-cats/sasha
sources:
- name: github
url: github.com

0 comments on commit 475c40c

Please sign in to comment.