-
Notifications
You must be signed in to change notification settings - Fork 730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Makefile update #901
Merged
Merged
Makefile update #901
Changes from 8 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
12f9389
Add .PHONY with all commands to no check for a file
ruflin 1d32d04
Refactor Makefile to use docker as default
ruflin 87b8c38
Make the docker environment the default for all make commands
ruflin 2893c3d
Save docx file in newer format to make it pass tests again
ruflin 654072f
Use only elastica image for most commands as full environment is not …
ruflin f792282
Fix Docker variable
ruflin c160500
Set DOCKER to "" for travis
ruflin 17ecebd
Add Docker images for the data environment to make Snapshot tests wor…
ruflin 4f026a1
Merge master
ruflin a030f58
Update ansible path for snapshots and apply linting. Remove unused ch…
ruflin 9332381
Simplify snapshot path names
ruflin ae97558
Merge in master and update to elasticsearch 1.7.1
ruflin ce02afd
Simplify docker and makefile
ruflin 56327d6
Merge Makefiles
ruflin 28869ac
Change snapshot directory from /mount/ to /tmp/ to make it writable o…
ruflin 9a7bc39
Change build oder of images as elastica-image must be built after loc…
ruflin 3cdb239
Make path tmp so it works on travis
ruflin af98a25
Update image plugin for docker environment
ruflin 37c72c4
Add socket extension for udp tests
ruflin 7b0ffbe
Remove udp tests to check for default host as "localhost" will not wo…
ruflin 4606f0e
Make shutdown tests compatible with docker environment
ruflin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,27 @@ | ||
# PHP 6 Docker file with Composer installed | ||
FROM composer/composer | ||
FROM ruflin/elastica-dev-base | ||
|
||
RUN apt-get update | ||
RUN apt-get upgrade -y | ||
RUN apt-get install -y nano | ||
RUN apt-get install -y cloc | ||
|
||
# XSL and Graphviz for PhpDocumentor | ||
RUN apt-get install -y php5-xsl | ||
# TODO: Debian is putting the xsl extension in a different directory, should be in: /usr/local/lib/php/extensions/no-debug-non-zts-20131226 | ||
RUN echo "extension=/usr/lib/php5/20131226/xsl.so" >> /usr/local/etc/php/conf.d/xsl.ini | ||
RUN apt-get install -y graphviz | ||
|
||
|
||
RUN echo "date.timezone=UTC" >> /usr/local/etc/php/conf.d/timezone.ini | ||
|
||
# Xdebug for coverage report | ||
RUN pecl install xdebug | ||
RUN echo "zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so" >> /usr/local/etc/php/conf.d/xdebug.ini | ||
|
||
# Memcache | ||
RUN apt-get install -y php5-memcache | ||
RUN echo "extension=/usr/lib/php5/20131226/memcache.so" >> /usr/local/etc/php/conf.d/memcache.ini | ||
|
||
# Add composer bin to the environment | ||
ENV PATH=/root/composer/vendor/bin:$PATH | ||
# ENVIRONMENT Setup - Needed in this image? | ||
ENV ES_HOST elasticsearch | ||
ENV PROXY_HOST nginx | ||
|
||
# Overcome github access limits. GITHUB_OAUTH_TOKEN environment variable must be set with private token | ||
RUN composer self-update | ||
# Install depdencies | ||
WORKDIR /elastica | ||
|
||
# Install development tools | ||
RUN composer global require "phpunit/phpunit=~4.7" | ||
RUN composer global require "pdepend/pdepend=~2.0" | ||
RUN composer global require "phpmd/phpmd=~2.2" | ||
RUN composer global require "mayflower/php-codebrowser=~1.1" | ||
RUN composer global require "sebastian/phpcpd=~2.0" | ||
RUN composer global require "squizlabs/php_codesniffer=~2.3" | ||
RUN composer global require "phploc/phploc=~2.1" | ||
RUN composer global require "fabpot/php-cs-fixer=1.8.1" | ||
# Copy composer file first as this only changes rarely | ||
COPY composer.json /elastica/ | ||
COPY Makefile /elastica/ | ||
|
||
ENV ELASTICA_DEV true | ||
|
||
# Documentor dependencies | ||
RUN composer global require "phpdocumentor/template-zend=~1.3" | ||
RUN composer global require "phpdocumentor/phpdocumentor=~2.8" | ||
RUN make init | ||
|
||
# Install depdencies | ||
WORKDIR /app | ||
COPY composer.json /app/ | ||
RUN composer install | ||
# Copy rest of the files, ignoring .dockerignore files | ||
COPY lib /elastica/lib | ||
COPY test /elastica/test | ||
|
||
# Guzzle is not included composer.json because of PHP 5.3 | ||
RUN composer require "guzzlehttp/guzzle=~6.0" | ||
RUN make clean | ||
RUN make | ||
|
||
ENTRYPOINT [] | ||
|
||
ENV ES_HOST elasticsearch | ||
ENV PROXY_HOST nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
elastica: | ||
#build: . # In case the image must be built locally | ||
#build: . | ||
image: ruflin/elastica | ||
ports: | ||
- "9200:9200" | ||
volumes: | ||
- .:/app | ||
#volumes: | ||
# - .:/elastica | ||
links: | ||
- nginx | ||
- elasticsearch | ||
environment: | ||
- ES_HOST=elasticsearch | ||
- PROXY_HOST=nginx | ||
elasticsearch: | ||
#build: ./env/elasticsearch/ # In case image must be built locally | ||
#build: ./env/elasticsearch/ | ||
image: ruflin/elasticsearch-elastica | ||
volumes_from: | ||
- data | ||
nginx: | ||
image: nginx | ||
volumes: | ||
- ./env/nginx/nginx.conf:/etc/nginx/nginx.conf | ||
- ./env/nginx/mime.types:/etc/nginx/mime.types | ||
ports: | ||
- "12345" | ||
- "12346" | ||
- "80" | ||
#build: ./env/nginx/ | ||
image: ruflin/nginx-elastica | ||
links: | ||
- elasticsearch | ||
# data container to share data between elasticsearch nodes for snapshot testing | ||
data: | ||
image: ruflin/elastica-data | ||
volumes: | ||
- "/mount/backups/my_backup" | ||
- "/mount/longterm_backups/my_backup" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#/bin/bash | ||
|
||
# This creates the base image locally for local development. In case no local development is done anymore, make sure to remove this image. | ||
all: nginx-image elasticsearch-image elastica-dev-image elastica-image elastica-data | ||
# elastica image has to be built after elastica-dev image as it depends on it. Otherwise the remote image is fetched. | ||
|
||
elastica-image: | ||
docker build -t ruflin/elastica ../ | ||
|
||
elastica-dev-image: | ||
docker build -t ruflin/elastica-dev-base elastica/ | ||
|
||
|
||
elasticsearch-image: | ||
docker build -t ruflin/elasticsearch-elastica elasticsearch/ | ||
|
||
nginx-image: | ||
cd nginx | ||
docker build -t ruflin/nginx-elastica nginx/ | ||
|
||
elastica-data: | ||
docker build -t ruflin/elastica-data data/ | ||
|
||
# Removes all local images | ||
clean: | ||
-docker rmi ruflin/elastica-dev-base | ||
-docker rmi ruflin/elasticsearch-elastica | ||
-docker rmi ruflin/nginx-elastica | ||
-docker rmi ruflin/elastica | ||
-docker rmi ruflin/elastica-data | ||
|
||
# Pushs images as latest to the docker registry. This is normally not needed as they are directly fetched and built from Github | ||
push: | ||
docker push ruflin/elastica-dev-base | ||
docker push ruflin/elasticsearch-elastica | ||
docker push ruflin/nginx-elastica | ||
docker push ruflin/elastica | ||
|
||
|
||
destroy: | ||
docker stop $(docker ps -a -q) | ||
docker rm $(docker ps -a -q) | ||
docker rmi $(docker images -q) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Data image | ||
FROM debian:jessie | ||
|
||
RUN mkdir -p /mount/backups/my_backup | ||
RUN mkdir -p /mount/longterm_backups/my_backup | ||
|
||
VOLUME /mount/backups/my_backup | ||
VOLUME /mount/longterm_backups/my_backup | ||
|
||
RUN chmod -R 777 /mount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
PHP base image for the development of Elastica. | ||
|
||
This image containts the basic setup for the development of Elastica. Part of this image are all parts which do not change often and do not need access to the source code of Elastica. The only file needed to build this image is the composer.json file in the folder `env/elastica/`. It contains a list of the global packages which are needed for the development environment like phpunit. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@im-denisenko I'm really unhappy about this line. Not the 777 but that I have to change the access rights after the images are running. What I need is a shared data container where all elasticsearch instances have write access. I tried to do it directly in the data image https://github.com/ruflin/Elastica/pull/901/files#diff-6ddc070b659c249d339814ba724740edR10 or also in the elasticsearch https://github.com/ruflin/Elastica/pull/901/files#diff-66fcadff5e0bc20f3becadf59df62f5bR28 But only the setup part works. I'm quite sure there is just a small command that can be used to get it working. Do you have any experience here?