Compare commits
3 Commits
d8dc527f88
...
e0f32d44b1
| Author | SHA1 | Date | |
|---|---|---|---|
| e0f32d44b1 | |||
| e5c20726a8 | |||
| 00c1886dc1 |
@ -7,22 +7,22 @@ RUN apt-get update && \
|
||||
# add yarn and php
|
||||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
|
||||
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
|
||||
curl -sS https://packages.sury.org/php/apt.gpg | apt-key add - && \
|
||||
echo "deb https://packages.sury.org/php/ stretch main" | tee /etc/apt/sources.list.d/php7.3.list && \
|
||||
apt-get update && \
|
||||
apt-get install -y yarn php7.0-cli && \
|
||||
apt-get install -y yarn php7.3-cli && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/* /tmp/* /var/tmp/*
|
||||
|
||||
|
||||
# add php fixer
|
||||
RUN curl -L https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.10.0/php-cs-fixer.phar -o /usr/local/bin/php-cs-fixer && \
|
||||
RUN curl -L https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.14.0/php-cs-fixer.phar -o /usr/local/bin/php-cs-fixer && \
|
||||
chmod a+x /usr/local/bin/php-cs-fixer
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# add csscomb and prettier
|
||||
RUN yarn add prettier csscomb --global && \
|
||||
ln -s /app/node_modules/.bin/prettier /usr/local/bin/prettier && \
|
||||
ln -s /app/node_modules/.bin/csscomb /usr/local/bin/csscomb
|
||||
RUN npm install prettier csscomb --global
|
||||
|
||||
COPY ["src/entry.sh", "/app/entry.sh"]
|
||||
|
||||
|
||||
@ -14,15 +14,13 @@ RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
|
||||
|
||||
|
||||
# add php fixer
|
||||
RUN curl -L https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.10.0/php-cs-fixer.phar -o /usr/local/bin/php-cs-fixer && \
|
||||
RUN curl -L https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.14.0/php-cs-fixer.phar -o /usr/local/bin/php-cs-fixer && \
|
||||
chmod a+x /usr/local/bin/php-cs-fixer
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# add csscomb and prettier
|
||||
RUN yarn add prettier csscomb --global && \
|
||||
ln -s /app/node_modules/.bin/prettier /usr/local/bin/prettier && \
|
||||
ln -s /app/node_modules/.bin/csscomb /usr/local/bin/csscomb
|
||||
RUN npm install prettier csscomb --global
|
||||
|
||||
COPY ["src/entry.sh", "/app/entry.sh"]
|
||||
|
||||
|
||||
@ -17,17 +17,18 @@ GIT_TAG = $(shell git describe --tags --exact-match 2>/dev/null)
|
||||
|
||||
VERSION := $(or $(GIT_TAG),latest)
|
||||
|
||||
all : VERSION := 1.0.3
|
||||
all : VERSION := 1.1.0
|
||||
all : build release
|
||||
.PHONY : all
|
||||
|
||||
|
||||
build :
|
||||
docker build --build-arg VERSION=$(VERSION) --build-arg COMMIT_SHA=$(COMMIT) -t $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.0 .
|
||||
docker build --build-arg VERSION=$(VERSION) --build-arg COMMIT_SHA=$(COMMIT) -t $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php5.6 .
|
||||
docker tag $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.0 $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)
|
||||
docker build --build-arg VERSION=$(VERSION) --build-arg COMMIT_SHA=$(COMMIT) -t $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.3 .
|
||||
docker tag $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.3 $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)
|
||||
docker tag $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.3 $(DOCKER_REGISTRY)/$(APP_NAME):latest
|
||||
|
||||
release : build
|
||||
docker push $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.0
|
||||
docker push $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.3
|
||||
docker push $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php5.6
|
||||
docker push $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)
|
||||
docker push $(DOCKER_REGISTRY)/$(APP_NAME):latest
|
||||
|
||||
@ -49,13 +49,18 @@ main() {
|
||||
prettier)
|
||||
__initVariables "$@"
|
||||
source ${INCLUDES_PATH}/formatters/prettier.shinc
|
||||
__prettier
|
||||
if [[ ${#CSS_FILES[@]} -ne 0 ]]; then
|
||||
__prettier ${CSS_FILES[@]}
|
||||
fi
|
||||
if [[ ${#JS_FILES[@]} -ne 0 ]]; then
|
||||
__prettier ${JS_FILES[@]}
|
||||
fi
|
||||
return $?
|
||||
;;
|
||||
csscomb)
|
||||
__initVariables "$@"
|
||||
source ${INCLUDES_PATH}/formatters/csscomb.shinc
|
||||
__csscomb
|
||||
__csscomb ${CSS_FILES[@]}
|
||||
return $?
|
||||
;;
|
||||
php-cs-fixer)
|
||||
|
||||
@ -3,11 +3,12 @@
|
||||
|
||||
__csscomb() {
|
||||
__msg "Csscomb:"
|
||||
local files="${1}"
|
||||
|
||||
if [[ ${DRY_RUN} -eq 0 ]]; then
|
||||
csscomb -v "${CSS_FILES[@]}"
|
||||
csscomb -v "${files[@]}"
|
||||
else
|
||||
csscomb --lint -v "${CSS_FILES[@]}"
|
||||
csscomb --lint -v "${files[@]}"
|
||||
fi
|
||||
|
||||
return $?
|
||||
|
||||
@ -3,12 +3,13 @@
|
||||
|
||||
__prettier() {
|
||||
__msg "Prettier:"
|
||||
local files="${1}"
|
||||
|
||||
if [[ ${DRY_RUN} -eq 0 ]]; then
|
||||
prettier --write "${JS_FILES[@]}"
|
||||
prettier --write "${files[@]}"
|
||||
else
|
||||
__msg "Listing (: unprettiered :) files:" 1
|
||||
prettier --list-different "${JS_FILES[@]}"
|
||||
prettier --list-different "${files[@]}"
|
||||
fi
|
||||
|
||||
return $?
|
||||
|
||||
@ -11,13 +11,15 @@ process() {
|
||||
|
||||
# Run css comb
|
||||
if [[ ${#CSS_FILES[@]} -ne 0 ]]; then
|
||||
__csscomb
|
||||
__csscomb "${CSS_FILES[@]}"
|
||||
[[ $? -ne 0 ]] && failed=1
|
||||
__prettier "${CSS_FILES[@]}"
|
||||
[[ $? -ne 0 ]] && failed=1
|
||||
fi
|
||||
|
||||
# Run JS prettier
|
||||
if [[ ${#JS_FILES[@]} -ne 0 ]]; then
|
||||
__prettier
|
||||
__prettier "${JS_FILES[@]}"
|
||||
[[ $? -ne 0 ]] && failed=1
|
||||
fi
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ http://{{ $host }}, https://{{ $host }} {
|
||||
}
|
||||
|
||||
gzip {
|
||||
not /__webpack_hmr/
|
||||
not /__webpack_hmr
|
||||
}
|
||||
log stdout
|
||||
errors stderr
|
||||
|
||||
Loading…
Reference in New Issue
Block a user