Skip to content

Commit

Permalink
Merge pull request #345 from JrGoodle/swift-update-doc
Browse files Browse the repository at this point in the history
Update Swift update_checkout docs and add bages
  • Loading branch information
JrGoodle committed Oct 26, 2017
2 parents 9707ea2 + 690bf5c commit 247594c
Show file tree
Hide file tree
Showing 9 changed files with 227 additions and 16 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# `clowder` [![Build Status](https://travis-ci.org/JrGoodle/clowder.svg)](https://travis-ci.org/JrGoodle/clowder)
# `clowder`
[![Build Status](https://travis-ci.org/JrGoodle/clowder.svg)](https://travis-ci.org/JrGoodle/clowder)
[![Coverage Status](https://coveralls.io/repos/github/JrGoodle/clowder/badge.svg?branch=master)](https://coveralls.io/github/JrGoodle/clowder?branch=master)
[![PyPI version](https://badge.fury.io/py/clowder-repo.svg)](https://badge.fury.io/py/clowder-repo)
[![Python version](https://img.shields.io/pypi/pyversions/clowder-repo.svg)](https://pypi.python.org/pypi/clowder-repo)
[![License](https://img.shields.io/pypi/l/clowder-repo.svg)](https://pypi.python.org/pypi/clowder-repo)
[![Status](https://img.shields.io/pypi/status/clowder-repo.svg)](https://pypi.python.org/pypi/clowder-repo)
[![Requirements Status](https://requires.io/github/JrGoodle/clowder/requirements.svg?branch=master)](https://requires.io/github/JrGoodle/clowder/requirements/?branch=master)
[![Documentation Status](https://readthedocs.org/projects/clowder/badge/?version=latest)](http://clowder.readthedocs.io/en/latest/?badge=latest)

> **clowder** - A group of cats
Expand Down
2 changes: 1 addition & 1 deletion clowder/clowder/clowder_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def status(self, group_names, padding):
for group in groups:
print(fmt.group_name(group.name))
for project in group.projects:
project.status(padding=padding)
print(project.status(padding=padding))

def sync(self, project_names, rebase=False, parallel=False):
"""Sync projects"""
Expand Down
9 changes: 7 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
- Description of the `clowder.yaml` file
- [Forks](forks.md)
- Description of the behavior of `clowder` commands with forks
- [Swift update](swift-update.md)
- Comparison between `clowder` and Swift's [update_checkout.py](https://github.com/apple/swift/blob/master/utils/update_checkout.py) script and [update-checkout-config.json](https://github.com/apple/swift/blob/master/utils/update-checkout-config.json) schemes

## Commands

Expand All @@ -25,3 +23,10 @@

- [Development](development.md)
- Information for `clowder` development

## Swift

- [Swift update_checkout json config](swift-update-checkout-config-json.md)
- Comparison between `clowder.yaml` and Swift's [update-checkout-config.json](https://github.com/apple/swift/blob/master/utils/update-checkout-config.json) schemes
- [Swift update_checkout script](swift-update-checkout-py.md)
- Comparison between `clowder` and Swift's [update_checkout.py](https://github.com/apple/swift/blob/master/utils/update_checkout.py) script
168 changes: 168 additions & 0 deletions docs/swift-update-checkout-config-json.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# Swift `update-checkout-config.json`

Swift uses the [update-checkout-config.json file](https://github.com/apple/swift/blob/master/utils/update-checkout-config.json) to track various branch schemes. The [swift-clowder repo](https://github.com/JrGoodle/swift-clowder/tree/swift) contains equivalent `clowder.yaml` files

## Default Configuration

The default branch setup is represented in `update-checkout-config.json`

```json
{
"ssh-clone-pattern": "git@github.com:%s.git",
"https-clone-pattern": "https://github.com/%s.git",
"repos" : {
"llvm": {
"remote": { "id": "apple/swift-llvm" } },
"clang": {
"remote": { "id": "apple/swift-clang" } },
"swift": {
"remote": { "id": "apple/swift" } },
"lldb": {
"remote": { "id": "apple/swift-lldb" } },
"cmark": {
"remote": { "id": "apple/swift-cmark" } },
"llbuild": {
"remote": { "id": "apple/swift-llbuild" } },
"swiftpm": {
"remote": { "id": "apple/swift-package-manager" } },
"compiler-rt": {
"remote": { "id": "apple/swift-compiler-rt" } },
"swift-corelibs-xctest": {
"remote": { "id": "apple/swift-corelibs-xctest" } },
"swift-corelibs-foundation": {
"remote": { "id": "apple/swift-corelibs-foundation" } },
"swift-corelibs-libdispatch": {
"remote": { "id": "apple/swift-corelibs-libdispatch" } },
"swift-integration-tests": {
"remote": { "id": "apple/swift-integration-tests" } },
"swift-xcode-playground-support": {
"remote": { "id": "apple/swift-xcode-playground-support" } },
"ninja": {
"remote": { "id": "ninja-build/ninja" } }
},
"default-branch-scheme": "master",
"branch-schemes": {
"master": {
"aliases": ["master", "stable"],
"repos": {
"llvm": "stable",
"clang": "stable",
"swift": "master",
"lldb": "stable",
"cmark": "master",
"llbuild": "master",
"swiftpm": "master",
"compiler-rt": "stable",
"swift-corelibs-xctest": "master",
"swift-corelibs-foundation": "master",
"swift-corelibs-libdispatch": "master",
"swift-integration-tests": "master",
"swift-xcode-playground-support": "master",
"ninja": "release"
}
}
}
}
```

An equivalent [default clowder.yaml](https://github.com/JrGoodle/swift-clowder/blob/master/clowder.yaml)

```yaml
defaults:
ref: refs/heads/master
remote: origin
source: github
recursive: true

sources:
- name: github
url: ssh://git@github.com
- name: github-https
url: https://github.com

groups:
- name: swift
projects:
- name: apple/swift
path: swift
- name: llvm
ref: refs/heads/stable
projects:
- name: apple/swift-llvm
path: llvm
timestamp_author: swift-ci
- name: apple/swift-clang
path: clang
timestamp_author: swift-ci
- name: apple/swift-compiler-rt
path: compiler-rt
- name: apple/swift-lldb
path: lldb
timestamp_author: swift-ci
- name: swift-corelibs
projects:
- name: apple/swift-corelibs-foundation
path: swift-corelibs-foundation
- name: apple/swift-corelibs-libdispatch
path: swift-corelibs-libdispatch
- name: apple/swift-corelibs-xctest
path: swift-corelibs-xctest
- name: apple/swift-integration-tests
path: swift-integration-tests
- name: apple/swift-xcode-playground-support
path: swift-xcode-playground-support
- name: swift-package-manager
projects:
- name: apple/swift-package-manager
path: swiftpm
- name: apple/swift-llbuild
path: llbuild
- name: third-party
projects:
- name: apple/swift-cmark
path: cmark
- name: ninja-build/ninja
path: ninja
ref: refs/heads/release
```

## Versions

The `swift-4.0-branch` version is represented in `update-checkout-config.json`

```json
"swift-4.1-branch" : {
"aliases": ["swift-4.1-branch"],
"repos": {
"llvm": "swift-4.1-branch",
"clang": "swift-4.1-branch",
"swift": "swift-4.1-branch",
"lldb": "swift-4.1-branch",
"cmark": "swift-4.1-branch",
"llbuild": "swift-4.1-branch",
"swiftpm": "swift-4.1-branch",
"compiler-rt": "swift-4.1-branch",
"swift-corelibs-xctest": "swift-4.1-branch",
"swift-corelibs-foundation": "swift-4.1-branch",
"swift-corelibs-libdispatch": "swift-4.1-branch",
"swift-integration-tests": "swift-4.1-branch",
"swift-xcode-playground-support": "swift-4.1-branch",
"ninja": "release"
}
},
```

An equivalent [swift-4.1-branch clowder.yaml](https://github.com/JrGoodle/swift-clowder/blob/master/versions/swift-4.1-branch/clowder.yaml)

```yaml
import default

defaults:
ref: refs/heads/swift-4.1-branch

groups:
- name: llvm
ref: refs/heads/swift-4.1-branch
```

By utilizing the import ability of `clowder`, the version file only needs to override necessary values, and inherits all the remaining defaults
39 changes: 39 additions & 0 deletions docs/swift-update-checkout-py.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Swift `update-checkout.py`

Swift uses the [update_checkout.py](https://github.com/apple/swift/blob/master/utils/update_checkout.py) file to manage repo states. The functionality is similar to certain `clowder` commands, but is baked into the Swift repository

## Initial Checkout

### `update_checkout.py`

```bash
mkdir swift-source
cd swift-source
git clone https://github.com/apple/swift.git
./swift/utils/update-checkout --clone-with-ssh
```

### `clowder`

```bash
mkdir swift-source
cd swift-source
clowder init git@github.com:JrGoodle/swift-clowder.git
clowder herd
```

## Checkout Version

### `update_checkout.py`

```bash
swift/utils/update-checkout --scheme swift-4.0-branch --reset-to-remote --clone --clean
swift/utils/update-checkout --scheme swift-4.0-branch --match-timestamp
```

### `clowder`

```bash
clowder link -v swift-4.0-branch
clowder reset --timestamp apple/swift
```
9 changes: 0 additions & 9 deletions docs/swift-update.md

This file was deleted.

2 changes: 1 addition & 1 deletion examples/swift-projects/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" || exit 1

clowder init https://github.com/jrgoodle/swift-clowder.git || exit 1
clowder init https://github.com/jrgoodle/swift-clowder.git -b test || exit 1
2 changes: 1 addition & 1 deletion test/scripts/swift/configure_remotes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ test_local_swift_example() {
mkdir swift-source || exit 1
pushd swift-source || exit 1

clowder init https://github.com/JrGoodle/swift-clowder.git || exit 1
clowder init https://github.com/JrGoodle/swift-clowder.git -b test || exit 1
clowder link -v jrgoodle-fork-travis-ci || exit 1

test_configure_remotes_herd
Expand Down
2 changes: 1 addition & 1 deletion test/scripts/swift/write_configure_remotes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cd "$SWIFT_EXAMPLE_DIR" || exit 1
if [ "$ACCESS_LEVEL" == "write" ]; then
mkdir swift-source || exit 1
pushd swift-source || exit 1
clowder init git@github.com:JrGoodle/swift-clowder.git || exit 1
clowder init git@github.com:JrGoodle/swift-clowder.git -b test || exit 1
clowder link -v jrgoodle-fork || exit 1

test_configure_remotes_herd() {
Expand Down

0 comments on commit 247594c

Please sign in to comment.