Skip to content

Commit

Permalink
Merge pull request #5 from teamleadercrm/docker-cli-image
Browse files Browse the repository at this point in the history
Create a docker image for this CLI tool
  • Loading branch information
jenssegers authored Oct 2, 2018
2 parents 15d41e2 + 72a2b63 commit 6e41a8d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM php:7-cli-alpine

# Install composer
RUN curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/bin/composer

# Copy source code
COPY . /source

# Install dependencies
RUN cd source && composer install

# The project folder
WORKDIR "/project"

# Run onesky cli command
ENTRYPOINT ["/source/entrypoint.sh"]
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
## Installation
## Usage

Install globally:
This project builds a docker image called `teamleader/onesky`. To pull the image on your local machine:

```bash
composer global require teamleader/onesky-cli
docker pull teamleader/onesky
```

Or install locally:
To use it, run the docker container with your current working directory to the `/project` folder.

```bash
composer require teamleader/onesky-cli
docker run -v $(pwd):/project teamleader/onesky
```

## Configuration

Your project needs a `onesky.yml`, file which can be generate:

```bash
onesky init
docker run -v $(pwd):/project teamleader/onesky init
```

Then edit this file and your api key, secret and project id.
Expand All @@ -27,7 +27,7 @@ Then edit this file and your api key, secret and project id.
You can check all available commands using:

```bash
onesky list
docker run -v $(pwd):/projectteamleader/onesky list
```

#### Uploading translations
Expand All @@ -37,7 +37,7 @@ Arguments:
- source file name

```bash
onesky upload nl-BE nl/app.json
docker run -v $(pwd):/projectteamleader/onesky upload nl-BE nl/app.json
```

#### Downloading translations
Expand All @@ -48,5 +48,5 @@ Arguments:
- source file name

```bash
onesky download fr-BE fr/app.json app.json
docker run -v $(pwd):/projectteamleader/onesky download fr-BE fr/app.json app.json
```
3 changes: 3 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh

cd /project && /source/bin/onesky $@

0 comments on commit 6e41a8d

Please sign in to comment.