Commit 4e20e113 authored by David Coutadeur's avatar David Coutadeur
Browse files

add Makefile for helping launching FusionIAM

parent d7455760
FVERSION=build/VERSION
CTN=`which podman >/dev/null 2>&1 && echo podman || echo docker`
IMAGENAME="fusioniam-centos8"
VVERSION=`cat $(FVERSION)`
IDLDAP=`podman ps | grep 'fusioniam-directory-server' | sed -e 's/[ ].*//'`
IDWPB=`podman ps | grep 'fusioniam-white-pages-php-fpm' | sed -e 's/[ ].*//'`
IDWPF=`podman ps | grep 'fusioniam-white-pages-nginx' | sed -e 's/[ ].*//'`
IDSDB=`podman ps | grep 'fusioniam-service-desk-php-fpm' | sed -e 's/[ ].*//'`
IDSDF=`podman ps | grep 'fusioniam-service-desk-nginx' | sed -e 's/[ ].*//'`
IDLEMONB=`podman ps | grep 'fusioniam-access-manager-fastcgi-server' | sed -e 's/[ ].*//'`
IDLEMONF=`podman ps | grep 'fusioniam-access-manager-nginx' | sed -e 's/[ ].*//'`
IDLEMONC=`podman ps | grep 'fusioniam-access-manager-cron' | sed -e 's/[ ].*//'`
IDBASE=`podman ps | grep 'fusioniam-database' | sed -e 's/[ ].*//'`
IDFDB=`podman ps | grep 'fusioniam-fusiondirectory-php-fpm' | sed -e 's/[ ].*//'`
IDFDF=`podman ps | grep 'fusioniam-fusiondirectory-nginx' | sed -e 's/[ ].*//'`
################################################################################
# Run commands
################################################################################
runldap:
mkdir -p run/volumes/ldap-data run/volumes/ldap-config
$(CTN) run \
--env-file=./run/ENVVAR.example \
-v ./run/volumes/ldap-data:/usr/local/openldap/var/openldap-data \
-v ./run/volumes/ldap-config:/usr/local/openldap/etc/openldap/slapd.d \
--rm=true \
-p 127.0.0.1:33389:33389 \
--name=fusioniam-directory-server \
--detach=true \
--no-hosts \
localhost/fusioniam-centos8-openldap-ltb:v0.1
runwp:
mkdir -p run/volumes/wp-run
$(CTN) run \
--env-file=./run/ENVVAR.example \
-v ./run/volumes/wp-run:/run/php-fpm/ \
--rm=true \
--name=fusioniam-white-pages-php-fpm \
--detach=true \
--no-hosts \
--network=slirp4netns:allow_host_loopback=true \
--entrypoint='["/bin/bash","/run-ct.sh","php-fpm"]' \
localhost/fusioniam-centos8-white-pages:v0.1
$(CTN) run \
--env-file=./run/ENVVAR.example \
-v ./run/volumes/wp-run:/var/run/php-fpm/ \
--rm=true \
-p 127.0.0.1:8083:8080 \
--name=fusioniam-white-pages-nginx \
--detach=true \
--no-hosts \
--entrypoint='["/bin/bash","/run-ct.sh","nginx"]' \
localhost/fusioniam-centos8-white-pages:v0.1
runsd:
mkdir -p run/volumes/sd-run
$(CTN) run \
--env-file=./run/ENVVAR.example \
-v ./run/volumes/sd-run:/run/php-fpm/ \
--rm=true \
--name=fusioniam-service-desk-php-fpm \
--detach=true \
--no-hosts \
--network=slirp4netns:allow_host_loopback=true \
--entrypoint='["/bin/bash","/run-ct.sh","php-fpm"]' \
localhost/fusioniam-centos8-service-desk:v0.1
$(CTN) run \
--env-file=./run/ENVVAR.example \
-v ./run/volumes/sd-run:/var/run/php-fpm/ \
--rm=true \
-p 127.0.0.1:8082:8080 \
--name=fusioniam-service-desk-nginx \
--detach=true \
--no-hosts \
--entrypoint='["/bin/bash","/run-ct.sh","nginx"]' \
localhost/fusioniam-centos8-service-desk:v0.1
runlemon:
mkdir -p run/volumes/sso-data
mkdir -p run/volumes/llng-run
mkdir -p run/volumes/llng-cache
mkdir -p run/volumes/llng-keys
$(CTN) run \
--env-file=./run/ENVVAR.example \
-v ./run/volumes/sso-data:/var/lib/postgresql/data \
--rm=true \
-p 127.0.0.1:33432:5432 \
--name=fusioniam-database \
--detach=true \
--no-hosts \
docker.io/library/postgres
$(CTN) run \
--env-file=./run/ENVVAR.example \
-v ./run/volumes/llng-run:/run/llng-fastcgi-server \
-v ./run/volumes/llng-cache:/var/cache/lemonldap-ng \
-v ./run/volumes/llng-keys:/etc/lemonldap-ng-keys \
--rm=true \
--name=fusioniam-access-manager-fastcgi-server \
--detach=true \
--no-hosts \
--network=slirp4netns:allow_host_loopback=true \
--entrypoint='["/bin/bash","/run-ct.sh","llng-fastcgi-server"]' \
localhost/fusioniam-centos8-lemonldap-ng:v0.1
$(CTN) run \
--env-file=./run/ENVVAR.example \
-v ./run/volumes/llng-run:/run/llng-fastcgi-server \
-v ./run/volumes/llng-cache:/var/cache/lemonldap-ng \
-v ./run/volumes/llng-keys:/etc/lemonldap-ng-keys \
--rm=true \
-p 127.0.0.1:8080:8080 \
--name=fusioniam-access-manager-nginx \
--detach=true \
--no-hosts \
--network=slirp4netns:allow_host_loopback=true \
--entrypoint='["/bin/bash","/run-ct.sh","nginx"]' \
localhost/fusioniam-centos8-lemonldap-ng:v0.1
$(CTN) run \
--env-file=./run/ENVVAR.example \
-v ./run/volumes/llng-run:/run/llng-fastcgi-server \
-v ./run/volumes/llng-cache:/var/cache/lemonldap-ng \
-v ./run/volumes/llng-keys:/etc/lemonldap-ng-keys \
--rm=true \
--name=fusioniam-access-manager-cron \
--detach=true \
--no-hosts \
--network=slirp4netns:allow_host_loopback=true \
--entrypoint='["/bin/bash","/run-ct.sh","purge-sessions"]' \
localhost/fusioniam-centos8-lemonldap-ng:v0.1
runfd:
mkdir -p run/volumes/fd-run
$(CTN) run \
--env-file=./run/ENVVAR.example \
-v ./run/volumes/fd-run:/run/php-fpm/ \
--rm=true \
--name=fusioniam-fusiondirectory-php-fpm \
--detach=true \
--no-hosts \
--network=slirp4netns:allow_host_loopback=true \
--entrypoint='["/bin/bash","/run-ct.sh","php-fpm"]' \
localhost/fusioniam-centos8-fusiondirectory:v0.1
$(CTN) run \
--env-file=./run/ENVVAR.example \
-v ./run/volumes/fd-run:/var/run/php-fpm/ \
--rm=true \
-p 127.0.0.1:8081:8080 \
--name=fusioniam-fusiondirectory-nginx \
--detach=true \
--no-hosts \
--entrypoint='["/bin/bash","/run-ct.sh","nginx"]' \
localhost/fusioniam-centos8-fusiondirectory:v0.1
runall: runldap runwp runsd runlemon runfd
################################################################################
# Stop commands
################################################################################
stopldap:
$(CTN) stop $(IDLDAP)
stopwp:
$(CTN) stop $(IDWPF) $(IDWPB)
stopsd:
$(CTN) stop $(IDSDF) $(IDSDB)
stoplemon:
$(CTN) stop $(IDLEMONF) $(IDLEMONB) $(IDLEMONC) $(IDBASE)
stopfd:
$(CTN) stop $(IDFDB) $(IDFDF)
stopall: stopldap stopwp stopsd stoplemon stopfd
################################################################################
# Enter commands
################################################################################
enterldap:
$(CTN) exec -it $(IDLDAP) /bin/bash
enterwp:
$(CTN) exec -it $(IDWPB) /bin/bash
entersd:
$(CTN) exec -it $(IDSDB) /bin/bash
enterlemon:
$(CTN) exec -it $(IDLEMONB) /bin/bash
enterfd:
$(CTN) exec -it $(IDFDB) /bin/bash
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment