1.0.0 • Published 2 years ago

@sakshiluthra/sib_marketing v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Mailin Zend

This project is known as marketing platform, which includes creation and management of email and sms campaigns, contact management, marketing campaign reports, settings related to campaign and contact.

Its based on zend framework 1 along with different templating like phtml, react, angular and jquery.

React components are getting imported from another repository. Check it here.

Prerequisite

  1. Docker (incl. Docker Compose) must be installed on the machine before continue.
  2. Access to the Sib's container registry at gcr.io/platform-staging-200307 must be configured. You can do it by executing the following command:
$ docker login -u _json_key --password-stdin https://gcr.io < .travis/gcloud-auth-staging.json

Disclaimer: It is well known that storing credentials within the repository is a bad practice. Thus, an advanced developer is more then welcome to configure access using their own credentials. However, since the credentials are already a part of this repository it was decided to reuse them rather than enforce developers to get access to the Google Cloud Console (which is currently not part of the onboarding process) as well as generate their own keyfile.json. Please be aware, that this topic could be revisited in the future.

Setting Up for Development

Open terminal, clone the project's repository, and run the project by executing the following commands:

$ docker-compose up

Setup Network Host

Update the hosts file (e.g. /etc/hosts on Mac) to map the domain local-my.sendinblue.com to the localhost by adding the following line:

127.0.0.1 local-my.sendinblue.com

For local Reseller development the following host must be mapped to localhost:

127.0.0.1 local-reseller.sendinblue.com

The application can then be accessed using following URLs: http://local-my.sendinblue.com:8010 and http://local-reseller.sendinblue.com:8010 accordingly.

Possible Issues

Not Able to Pull the Images
ERROR: unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication

The issue means that docker login command is either not worked or the key has expired. Please follow the Google Cloud instruction for key generation.

Upstream Services are Not Available on Linux

Because of the known issue, the host host.docker.internal is not available from within the containers on Linux systems. Adding the host mapping might be used as a workaround to fix this issue:

$ DOCKER_HOST_IP=$(ip addr show | grep "\binet\b.*\bdocker0\b" | awk '{print $2}' | cut -d '/' -f 1) && \
    docker-compose exec web /bin/sh -c "grep -q host.docker.internal /etc/hosts || \
    echo \"$DOCKER_HOST_IP host.docker.internal\" >> /etc/hosts"

Cleanup Local Environment

Docker Compose is creating Docker volumes (e.g. for the MongoDB) which persist between runs. Use the following command to purge the service incl. the volumes:

$ docker-compose down -v