diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..2bb5df5 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +src +dist/README.md diff --git a/.gitignore b/.gitignore index 99237d9..d0b4319 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ dist .vagrant +src diff --git a/Dockerfile b/Dockerfile index 34c653d..1fa3aea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -62,3 +62,13 @@ RUN echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/s COPY ./wait-for-it.sh ./wait-for-it.sh RUN chmod +x ./wait-for-it.sh +# Add all distributions in the "dist" directory before any other +# distributions. This way we can have pre-release modules in our dev +# environment. Do this last to take advantage of as much caching as +# possible above, even though any changes here mean rebuilding every +# downstream image... +COPY ./dist ./dist +RUN bash -vlc 'for DIST in ./dist/*; do \ + echo "Building pre-release: $DIST"; \ + cpanm -v --notest $DIST; \ + done && rm -rf ./dist' diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e290710 --- /dev/null +++ b/Makefile @@ -0,0 +1,52 @@ + +GH = https://github.com/orgs/cpan-testers +SRC_DIR = src +REPOS = cpantesters-schema cpantesters-backend cpantesters-web cpantesters-api + +.PHONY: src docker docker-base docker-schema docker-backend docker-web docker-api \ + start stop + +src: + for REPO in $(REPOS); do \ + git clone $(GH)/$$REPO $(SRC_DIR)/$$REPO; \ + done + +docker-base: + @echo "Building base image as cpantesters/base..." + @docker build . --tag cpantesters/base >build-base.log + +docker-schema: docker-base + @BUILD="schema"; \ + REPO="cpantesters-$$BUILD"; \ + TAG="cpantesters/$$BUILD"; \ + echo "Building repo $$REPO as $$TAG..."; \ + docker build $(SRC_DIR)/$$REPO --tag $$TAG >build-$$BUILD.log; + +docker-backend: docker-base docker-schema + @BUILD="backend"; \ + REPO="cpantesters-$$BUILD"; \ + TAG="cpantesters/$$BUILD"; \ + echo "Building repo $$REPO as $$TAG..."; \ + docker build $(SRC_DIR)/$$REPO --tag $$TAG >build-$$BUILD.log; + +docker-web: docker-base docker-schema + @BUILD="web"; \ + REPO="cpantesters-$$BUILD"; \ + TAG="cpantesters/$$BUILD"; \ + echo "Building repo $$REPO as $$TAG..."; \ + docker build $(SRC_DIR)/$$REPO --tag $$TAG >build-$$BUILD.log; + +docker-api: docker-base docker-schema + @BUILD="api"; \ + REPO="cpantesters-$$BUILD"; \ + TAG="cpantesters/$$BUILD"; \ + echo "Building repo $$REPO as $$TAG..."; \ + docker build $(SRC_DIR)/$$REPO --tag $$TAG >build-$$BUILD.log; + +docker: docker-backend docker-web docker-api + +start: + @docker-compose up + +stop: + @docker-compose stop diff --git a/src/README.md b/src/README.md new file mode 100644 index 0000000..1c71471 --- /dev/null +++ b/src/README.md @@ -0,0 +1,6 @@ + +# Source directory + +This is where `make src` will put the Git repositories needed for +development. +