Skip to content

Commit

Permalink
1 setup and test
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Rademacher committed May 20, 2023
1 parent 240fc8e commit 95342ef
Show file tree
Hide file tree
Showing 12 changed files with 1,870 additions and 7 deletions.
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
composer.phar
/vendor/
# IDEs
.idea

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
# composer files
composer.phar
vendor/
41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,39 @@
# codewars-php70
Solving katas the old fashioned way.
# codewars
Great for learning and sharpening your coding skillz.

## Build PHP 7.0 Docker image
Use the build script in order to build the custom PHP 7.0 Docker image
`andrerademacher/codewars-php70`.

```bash
container/build.sh
```

## Run command in container
The `container.sh` script makes running commands in the Docker container easy!
To open a shell, just add the "sh" command:
```bash
container.sh sh
```

The current PHP version can be shown like this:
```bash
container.sh php --version
```

The Composer binary is already present in the latest 2.2 LTS version supporting PHP 7.0 .
To run any composer command, like `composer install`, just type:
```bash
container.sh composer install
```

After installing the dev dependencies, the PHPUnit test suite can be run
inside the container by calling the phpunit binary in the vendor directory:
```bash
container.sh vendor/bin/phpunit
```

For convenience, this can be done also by using the composer script:
```bash
container.sh composer phpunit
```
33 changes: 33 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "andrerademacher/codewars-php70",
"description": "Minimalistic PHP 7.0 environment for codewars",
"minimum-stability": "stable",
"license": "MIT",
"keywords": [
"codewars",
"php"
],
"authors": [
{
"name": "Andre Rademacher",
"email": "[email protected]"
}
],
"require-dev": {
"phpunit/phpunit": "^5.7"
},
"require": {
"php": "^7.0"
},
"autoload": {
"psr-4": {
"Kata\\": "kata"
}
},
"scripts": {
"qa": [
"phpunit"
],
"phpunit": "phpunit"
}
}
Loading

0 comments on commit 95342ef

Please sign in to comment.