Skip to content
Snippets Groups Projects
Commit 040a3f04 authored by Jose Raul Barreras's avatar Jose Raul Barreras
Browse files

Merge branch 'php-unit-test' into 'develop'

Add php-unit-test images and Vagrant template

See merge request !6
parents 90e5d96d f415d66c
Branches
No related tags found
2 merge requests!15Merge Develop into Master,!6Add php-unit-test images and Vagrant template
# Vagrant
.vagrant/
Vagrantfile
\ No newline at end of file
......@@ -21,42 +21,64 @@ BUILD_ARGS := --build-arg VCS_REF=$(GIT_COMMIT)
.PHONY: all clean test $(DOCKERFILES) clean_images $(IMAGES_TO_CLEAN) static-code-analysis delete_dangling_images security
all: \
php-lint_5.6 php-lint_7.0 php-lint_7.1 php-lint_7.2 php-lint_latest \
magento2-unit-test magento2-xml-lint \
static-code-analysis
all: php-lint php-unit-test magento2 static-code-analysis
# PHP Images
# Image Groups
####################
php-lint: php-lint_5.6 php-lint_7.0 php-lint_7.1 php-lint_7.2 php-lint_latest
php-unit-test: php-unit-test_5.6 php-unit-test_7.0 php-unit-test_7.1 php-unit-test_7.2 php-unit-test_latest
magento2: magento2-unit-test magento2-xml-lint
static-code-analysis: static-code-analysis_latest static-code-analysys_php static-code-analysys_python
# PHP Lint Images
####################
php-lint_5.6: php-lint/5.6/Dockerfile
docker build -t unl-its/php-lint:5.6 -f php-lint/5.6/Dockerfile php-lint
docker build $(BUILD_ARGS) -t unl-its/php-lint:5.6 -f php-lint/5.6/Dockerfile php-lint
php-lint_7.0: php-lint/7.0/Dockerfile
docker build -t unl-its/php-lint:7.0 -f php-lint/7.0/Dockerfile php-lint
docker build $(BUILD_ARGS) -t unl-its/php-lint:7.0 -f php-lint/7.0/Dockerfile php-lint
php-lint_7.1: php-lint/7.1/Dockerfile
docker build -t unl-its/php-lint:7.1 -f php-lint/7.1/Dockerfile php-lint
docker build $(BUILD_ARGS) -t unl-its/php-lint:7.1 -f php-lint/7.1/Dockerfile php-lint
php-lint_7.2: php-lint/7.2/Dockerfile
docker build -t unl-its/php-lint:7.2 -f php-lint/7.2/Dockerfile php-lint
docker build $(BUILD_ARGS) -t unl-its/php-lint:7.2 -f php-lint/7.2/Dockerfile php-lint
php-lint_latest: php-lint_7.2
docker tag unl-its/php-lint:7.2 unl-its/php-lint:latest
# PHP Unit Test Images
####################
php-unit-test_5.6: php-unit-test/5.6/Dockerfile
docker build $(BUILD_ARGS) -t unl-its/php-unit-test:5.6 -f php-unit-test/5.6/Dockerfile php-unit-test
php-unit-test_7.0: php-unit-test/7.0/Dockerfile
docker build $(BUILD_ARGS) -t unl-its/php-unit-test:7.0 -f php-unit-test/7.0/Dockerfile php-unit-test
php-unit-test_7.1: php-unit-test/7.1/Dockerfile
docker build $(BUILD_ARGS) -t unl-its/php-unit-test:7.1 -f php-unit-test/7.1/Dockerfile php-unit-test
php-unit-test_7.2: php-unit-test/7.2/Dockerfile
docker build $(BUILD_ARGS) -t unl-its/php-unit-test:7.2 -f php-unit-test/7.2/Dockerfile php-unit-test
php-unit-test_latest: php-unit-test_7.2
docker tag unl-its/php-unit-test:7.2 unl-its/php-unit-test:latest
# Application Images
####################
magento2-unit-test: magento2-unit-test/latest/Dockerfile
docker build -t unl-its/magento2-unit-test:latest magento2-unit-test/latest
docker build $(BUILD_ARGS) -t unl-its/magento2-unit-test:latest magento2-unit-test/latest
magento2-xml-lint: magento2-unit-test magento2-xml-lint/latest/Dockerfile
docker build -t unl-its/magento2-xml-lint:latest magento2-xml-lint/latest
docker build $(BUILD_ARGS) -t unl-its/magento2-xml-lint:latest magento2-xml-lint/latest
# Sonarqube static-code-analysis
# #####################
static-code-analysis:
static-code-analysis_latest: static-code-analysis/Dockerfile
docker build $(BUILD_ARGS) -t unl-its/static-code-analysis:latest static-code-analysis/
static-code-analysys_php: static-code-analysis/Dockerfile
docker build $(BUILD_ARGS) -t unl-its/static-code-analysis:php static-code-analysis/
static-code-analysys_python: static-code-analysis/Dockerfile
docker build $(BUILD_ARGS) -t unl-its/static-code-analysis:python static-code-analysis/
# Cleanup
......@@ -65,7 +87,7 @@ clean: clean_images
test: $(DOCKERFILES)
$(DOCKERFILES):
@echo "Linting and validating $(@D)..."
@echo "Linting and validating $(@D)..."
@docker run --rm -i nimmis/label-inspector lint < $(@D)/Dockerfile
@docker run --rm -i nimmis/label-inspector validate < $(@D)/Dockerfile
......
vm_name = "docker-ci"
Vagrant.configure(2) do |config|
# --- UNL Linux VM configuration -------------------------
config.vm.box = "centos/7"
config.vm.hostname = vm_name
config.vm.box_check_update = true
config.vbguest.auto_update = false
config.vm.network "private_network", ip: "192.168.100.101"
config.vm.synced_folder ".", "/vagrant", type: "nfs", mount_options: ['vers=3', :udp, :nolock, :noatime, :rw]
# virtualbox VM settings
config.vm.provider "virtualbox" do |vb|
vb.linked_clone = true
vb.name = vm_name
vb.memory = "512"
vb.cpus = "1"
end
# --------------------------------------------------------------------
# --- Inline provisioning ----------------------------------
config.vm.provision "shell", inline: <<-SHELL
yum update -y
sudo yum install -y make docker git
systemctl enable docker
systemctl start docker
chmod o+rw /var/run/docker.sock
SHELL
# --------------------------------------------------------------------
end
FROM php:5.6-alpine
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="PHP 5.6 Unit Tester" \
org.label-schema.description="" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vendor="University of Nebraska - Lincoln" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0" \
maintainer="Alan Nelson <alan.nelson@nebraska.edu>"
RUN apk add --no-cache bash nodejs nodejs-npm
RUN curl -o /usr/local/bin/composer https://getcomposer.org/composer.phar \
&& chmod 755 /usr/local/bin/composer
CMD ["bash"]
FROM php:7.0-alpine
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="PHP 5.6 Unit Tester" \
org.label-schema.description="" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vendor="University of Nebraska - Lincoln" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0" \
maintainer="Alan Nelson <alan.nelson@nebraska.edu>"
RUN apk add --no-cache bash nodejs nodejs-npm
RUN curl -o /usr/local/bin/composer https://getcomposer.org/composer.phar \
&& chmod 755 /usr/local/bin/composer
CMD ["bash"]
FROM php:7.1-alpine
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="PHP 5.6 Unit Tester" \
org.label-schema.description="" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vendor="University of Nebraska - Lincoln" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0" \
maintainer="Alan Nelson <alan.nelson@nebraska.edu>"
RUN apk add --no-cache bash nodejs nodejs-npm
RUN curl -o /usr/local/bin/composer https://getcomposer.org/composer.phar \
&& chmod 755 /usr/local/bin/composer
CMD ["bash"]
FROM php:7.2-alpine
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="PHP 5.6 Unit Tester" \
org.label-schema.description="" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vendor="University of Nebraska - Lincoln" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0" \
maintainer="Alan Nelson <alan.nelson@nebraska.edu>"
RUN apk add --no-cache bash nodejs nodejs-npm
RUN curl -o /usr/local/bin/composer https://getcomposer.org/composer.phar \
&& chmod 755 /usr/local/bin/composer
CMD ["bash"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment