Skip to content

Instantly share code, notes, and snippets.

@simbo1905
Last active December 2, 2018 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simbo1905/056d193328c81250a54b7c68f8a9e77b to your computer and use it in GitHub Desktop.
Save simbo1905/056d193328c81250a54b7c68f8a9e77b to your computer and use it in GitHub Desktop.
compile and test php on circleci using redhat openshift s2i image that matches OCP builds
version: 2.0
jobs:
build:
docker:
- image: "registry.access.redhat.com/rhscl/php-71-rhel7:latest"
steps:
- checkout:
path: /tmp/src/
# Download and cache dependencies
- restore_cache:
keys:
- rhel7-dependencies-{{ checksum "/tmp/src/composer.json" }}
- run:
name: s2i assemble
command: /usr/libexec/s2i/assemble
- save_cache:
paths:
- ./vendor
key: rhel7-dependencies-{{ checksum "composer.json" }}
# run tests!
- run: vendor/bin/phpunit --configuration phpunit.xml
@simbo1905
Copy link
Author

Note that s2i expects you to checkout into /tmp/src ten runs /usr/libexec/s2i/assemble. The other bits about caching the ./vendor folder is circleci.com specific to speed up your builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment