Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash -e
- # This file will perform initalization of raw dev working environment with latest images.
- function check() {
- if [ -z "$(command -v 'docker')" ]; then
- echo "docker is not installed"
- exit 1
- fi
- }
- function main() {
- check
- me=$(whoami)
- echo ">> Setting endpoints to use your username \"$me\""
- sed -i "s~xxxxx~${me}~g" docker-compose.yml
- echo "<< Done"
- echo ">> Create dev.env"
- cat > dev.env <<EOL
- DEVENV=docker_local
- DEV=docker_local
- EOL
- echo "<< Done"
- echo ">> Cloning all necessary repositories"
- git clone -q ssh://git@bitbucket.transactpro.lv:7999/gw3/uriel-go.git &
- git clone -q ssh://git@bitbucket.transactpro.lv:7999/gw3/raziel-go.git &
- git clone -q -b dev ssh://git@bitbucket.transactpro.lv:7999/gw3/tpro-gw3-integration.git integration &
- git clone -q -b dev ssh://git@bitbucket.transactpro.lv:7999/gw3/hsm-emulation.git &
- git clone -q -b dev ssh://git@bitbucket.transactpro.lv:7999/gw3/peliel.git &
- git clone -q ssh://git@bitbucket.transactpro.lv:7999/gw3/kerubiel.git &
- git clone -q ssh://git@bitbucket.transactpro.lv:7999/gw3/third-party-templates.git static &
- git clone -q -b dev ssh://git@bitbucket.transactpro.lv:7999/gw3/workers.git &
- git clone -q -b dev ssh://git@bitbucket.transactpro.lv:7999/gw3/prototype-frontend.git frontend &
- git clone -q -b dev ssh://git@bitbucket.transactpro.lv:7999/aut/docker.git &
- wait
- echo "<< Done"
- echo ">> Create storage directory and set permittions"
- mkdir -p storage/templates
- chmod -R 777 storage
- echo "<< Done"
- echo ">> Installing composer dependencies in needed projects"
- ( cd integration; composer install -q --no-dev; ) &
- ( cd hsm-emulation; composer install -q --no-dev; ) &
- ( cd workers; composer install -q --no-dev; ) &
- ( cd frontend; composer install -q --no-dev; ) &
- wait
- echo "<< Done"
- echo ">> Configure kerubiel config file"
- cdir=$(pwd)
- ndir=${PWD##*/} # https://stackoverflow.com/a/1371283
- (
- cd kerubiel
- cp containers.example.json containers.json
- sed -i "s~registry.transactpro.it/gw3/phpfpm:latest~registry.transactpro.it/gw3-prod/php:7.0.14~g" containers.json
- sed -i "s~/opt/gw3~${cdir}~g" containers.json
- sed -i "s~gw3_default~${ndir}_default~g" containers.json
- )
- echo "<< Done"
- echo ">> Download GeoLite2-City.mmdb file"
- wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz
- tar -xvf GeoLite2-City.tar.gz
- rm -f GeoLite2-City.tar.gz
- mv GeoLite2-City_*/GeoLite2-City.mmdb .
- rm -rf GeoLite2-City_*
- echo "<< Done"
- echo ">> Configure frontend"
- (
- cd frontend
- cat > wl-conf.local.json <<EOL
- {
- "tpro": {
- "whitelabel_id": 1,
- "title": "Transact Pro",
- "domain": "frontend.${me}.fpngw3.env",
- "tagline": "Turnkey Direct Financial E-Commerce Solutions. Since 2004."
- }
- }
- EOL
- npm install
- node ./node_modules/.bin/bower install
- ./build.styles local
- docker run --rm \
- -v $(pwd):/app \
- -w /app \
- registry.transactpro.it/gw3-prod/php:7.0.14 chmod -R 777 cache
- )
- echo "And it seems, that you are ready to rock!"
- echo "Run: docker-compose up -d"
- echo "And see the magic. Happy coding!"
- }
- main "$@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement