Skip to content

Commit

Permalink
feat(docs): Include guide on CircleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
kylef committed Dec 12, 2016
1 parent 84c79ec commit 688ba4f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/index.rst
Expand Up @@ -32,5 +32,6 @@ Integrations
integrations/heroku
integrations/travis-ci
integrations/gitlab-ci
integrations/circle-ci
integrations/docker
integrations/cocoapods
44 changes: 44 additions & 0 deletions docs/integrations/circle-ci.md
@@ -0,0 +1,44 @@
# CircleCI

You can use swiftenv in conjunction with Docker on
[CircleCI](https://circleci.com) to easily test your Swift project on CircleCI.

**NOTE:** *These instructions only cover using CircleCI on Linux and do not
apply to CircleCI macOS containers.*

### `Dockerfile`

A `Dockerfile` may contain the instructions to build a docker container
containing swiftenv, Swift and your source code.

The following `Dockerfile` shows an example of setting up swiftenv and
installing the version of Swift found in `.swift-version`.

You may also base your image on top of `kylef/swiftenv:swift3` or
`kylef/swiftenv:swift` to use pre-installed Swift versions.

```
FROM kylef/swiftenv
RUN mkdir -p /code
WORKDIR /code
ADD . /code
RUN swiftenv install
```

### `circle.yml`

Using a `circle.yml` file we can instruct CircleCI to build and run `swift
test` inside our docker container.

```yaml
machine:
services: docker

dependencies:
override: docker build -t myapp .

test:
override: docker run myapp swift test
```

0 comments on commit 688ba4f

Please sign in to comment.