Compare commits

..

No commits in common. "a8ac87cc2cfa73cf353890c6381b7dedd99e8ae1" and "b99086b922c121c89a99540f9c01a4d98db347e3" have entirely different histories.

5 changed files with 8 additions and 85 deletions

1
.gitignore vendored
View File

@ -1,2 +1 @@
**/env.shinc
.idea

View File

@ -1,25 +1,22 @@
FROM node:12-slim
ARG PHP_VERSION
ENV PHP_CS_FIXER_IGNORE_ENV=true
FROM node:10-slim
# https support
RUN apt-get update && \
apt-get install -y apt-transport-https ca-certificates curl gnupg2
apt-get install -y apt-transport-https ca-certificates
# 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/${PHP_VERSION}.list && \
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 ${PHP_VERSION}-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.16.3/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

View File

@ -23,15 +23,13 @@ all : build release
build :
docker build --build-arg VERSION=$(VERSION) --build-arg PHP_VERSION="php7.3" --build-arg COMMIT_SHA=$(COMMIT) -t $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.3 .
docker build --build-arg VERSION=$(VERSION) --build-arg PHP_VERSION="php7.4" --build-arg COMMIT_SHA=$(COMMIT) -t $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.4 .
docker build --build-arg VERSION=$(VERSION) --build-arg COMMIT_SHA=$(COMMIT) -t $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.3 .
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.4 $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)
docker tag $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.4 $(DOCKER_REGISTRY)/$(APP_NAME):latest
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.3
docker push $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php7.4
docker push $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)-php5.6
docker push $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION)
docker push $(DOCKER_REGISTRY)/$(APP_NAME):latest

View File

@ -117,19 +117,3 @@ help() {
return 0
}
realpath $PWD > /dev/null 2>&1
if [[ $? -ne 0 ]]; then
realpath() {
OURPWD=$PWD
cd "$(dirname "$1")"
LINK=$(readlink "$(basename "$1")")
while [ "$LINK" ]; do
cd "$(dirname "$LINK")"
LINK=$(readlink "$(basename "$1")")
done
REALPATH="$PWD/$(basename "$1")"
cd "$OURPWD"
echo "$REALPATH"
}
fi

View File

@ -1,55 +0,0 @@
#!/usr/bin/env bash
SCRIPT_PATH=$( cd "$(dirname "$0")" ; pwd -P )
IMAGE_NAME="usefathom/fathom"
IMAGE_VERSION="latest"
SERVICE_NAME=fathom
source ${SCRIPT_PATH}/../common.shinc
#
# Project specific variables
#
DOMAIN_NAME="fathom.loc"
source ${SCRIPT_PATH}/env.shinc 2> /dev/null
init() {
__init
NETWORKS=(${PROXY_NETWORK} ${DB_NETWORK})
__createNetworks
docker create \
--name ${SERVICE_NAME} \
-e VIRTUAL_HOST=${DOMAIN_NAME} \
-e VIRTUAL_PORT=8080 \
-e FATHOM_DATABASE_DRIVER="postgres" \
-e FATHOM_DATABASE_NAME="fathom" \
-e FATHOM_DATABASE_USER="root" \
-e FATHOM_DATABASE_PASSWORD="megaheslo" \
-e FATHOM_DATABASE_HOST="pgsql-db" \
-e FATHOM_DATABASE_SSLMODE="disable" \
-e FATHOM_SECRET="abcdefghijqrstuvw34567890" \
${IMAGE_NAME}:${IMAGE_VERSION}
[[ $? -ne 0 ]] && return 1
docker network connect ${PROXY_NETWORK} ${SERVICE_NAME}
[[ $? -ne 0 ]] && return 1
docker network connect ${DB_NETWORK} ${SERVICE_NAME}
[[ $? -ne 0 ]] && return 1
__ask_to_start
}
"$@"
exit $?