Luciano Andrade vor 8 Jahren
Ursprung
Commit
37d671a52e
7 geänderte Dateien mit 206 neuen und 15 gelöschten Zeilen
  1. 10 2
      .drone.yml
  2. 6 3
      Dockerfile
  3. 2 1
      app/AppKernel.php
  4. 8 1
      app/config/parameters.yml.dist
  5. 31 0
      app/config/parameters.yml.docker
  6. 2 1
      composer.json
  7. 147 7
      composer.lock

+ 10 - 2
.drone.yml

@@ -8,8 +8,16 @@ pipeline:
   build:
     image: debian:8.0
     commands:
-      - echo 'Acquire::http { Proxy "http://200.50.168.30:3142"; };' > /etc/apt/apt.conf.d/01proxy
-      - apt-get update && apt-get install -yq build-essential git unzip php5-cli php5-mysql wget mysql-client
+      - echo 'Acquire::http { Proxy "http://200.50.168.30:3142"; };' > /etc/apt/apt.conf.d/01proxy     
+      - apt-get update && apt-get install -yq build-essential git unzip php5-cli php5-mysql wget mysql-client php5-curl
+      
+      # RabbitMQ apt repository
+      - echo 'deb http://www.rabbitmq.com/debian/ testing main' | tee /etc/apt/sources.list.d/rabbitmq.list
+      - wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | apt-key add -
+      - apt-get update && apt-get install -yq rabbitmq-server
+      - echo 'export RABBITMQ_NODENAME=rabbit@localhost' | tee /etc/rabbitmq/rabbitmq-env.conf
+      - echo 'export RABBITMQ_NODE_IP_ADDRESS=127.0.0.1' | tee /etc/rabbitmq/rabbitmq-env.conf
+      - service rabbitmq-server restart
 
       - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
       - php composer-setup.php --install-dir=/usr/local/bin/ --filename=composer

+ 6 - 3
Dockerfile

@@ -1,8 +1,10 @@
 FROM debian:8
 EXPOSE 8000
 
+#RUN echo "Acquire::http::Proxy \"http://172.17.0.5:3142\";" | tee /etc/apt/apt.conf.d/00aptproxy
+
 RUN apt-get update 
-RUN apt-get install -yq git wget vim tmux php5-cli php5-mysql
+RUN apt-get install -yq git wget vim tmux php5-cli php5-mysql php5-curl
 
 RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
 RUN php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
@@ -13,6 +15,7 @@ ADD . /opt/ftth
 RUN rm -rf /opt/ftth/vendor/*
 
 RUN cp /opt/ftth/app/config/parameters.yml.docker /opt/ftth/app/config/parameters.yml
+RUN cp /opt/ftth/app/config/url_webservice.yml.dist /opt/ftth/app/config/url_webservice.yml
 
 RUN mkdir ~/.ssh
 RUN ssh-keyscan -H bitbucket.org >> ~/.ssh/known_hosts
@@ -23,8 +26,8 @@ WORKDIR /opt/ftth
 RUN chmod 0600 keys/*
 RUN eval $(ssh-agent) ; ssh-add keys/bitbucket.id_rsa ; composer install --no-scripts --no-interaction
 
-CMD rm var/cache/* -rf ;\
-        composer install -n ;\
+CMD eval $(ssh-agent) ; ssh-add keys/bitbucket.id_rsa ; composer install --no-scripts --no-interaction \
+	rm var/cache/* -rf ;\
         composer dump-autoload ;\
         composer run-script symfony-scripts ;\
         bin/console server:run 0.0.0.0

+ 2 - 1
app/AppKernel.php

@@ -30,7 +30,8 @@ class AppKernel extends Kernel
             new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
             new WorkflowBundle\WorkflowBundle(),
             new HWI\Bundle\OAuthBundle\HWIOAuthBundle(),
-            new Base\OAuthClientBundle\BaseOAuthClientBundle()
+            new Base\OAuthClientBundle\BaseOAuthClientBundle(),
+            new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(),
         ];
 
         if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {

+ 8 - 1
app/config/parameters.yml.dist

@@ -20,4 +20,11 @@ parameters:
     jms_serializer.camel_case_naming_strategy.class: JMS\Serializer\Naming\IdenticalPropertyNamingStrategy
 
     # Url para logout en repositorio base
-    url_logout: 'http://127.0.0.1/base/app_dev.php/logout'
+    url_logout: 'http://127.0.0.1/base/app_dev.php/logout'
+
+    # RabbitMQ parameters
+    rabbit_mq.host:     'localhost'
+    rabbit_mq.port:     5672
+    rabbit_mq.user:     'guest'
+    rabbit_mq.password: 'guest'
+    rabbit_mq.vhost:    '/'

+ 31 - 0
app/config/parameters.yml.docker

@@ -0,0 +1,31 @@
+# This file is a "template" of what your parameters.yml file should look like
+# Set parameters here that may be different on each deployment target of the app, e.g. development, staging, production.
+# http://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
+parameters:
+    database_driver:   pdo_mysql
+    database_host:     db
+    database_port:     ~
+    database_name:     fd3_ftth
+    database_user:     root
+    database_password: 235r2342gtfsw
+    # You should uncomment this if you want use pdo_sqlite
+    # database_path: "%kernel.root_dir%/data.db3"
+
+    mailer_transport:  smtp
+    mailer_host:       127.0.0.1
+    mailer_user:       ~
+    mailer_password:   ~
+
+    # A secret key that's used to generate certain security-related tokens
+    secret:            ThisTokenIsNotSoSecretChangeIt
+    jms_serializer.camel_case_naming_strategy.class: JMS\Serializer\Naming\IdenticalPropertyNamingStrategy
+
+    # Url para logout en repositorio base
+    url_logout: 'http://127.0.0.1/base/app_dev.php/logout'
+
+    # amqp queue config
+    rabbit_mq.host:     'amqp'
+    rabbit_mq.port:     5672
+    rabbit_mq.user:     'guest'
+    rabbit_mq.password: 'guest'
+    rabbit_mq.vhost:    '/'

+ 2 - 1
composer.json

@@ -71,7 +71,8 @@
         "ik/oauthclient-bundle": "dev-master",
         "ik/webservice-bundle": "dev-master",
         "hwi/oauth-bundle": "^0.5.3",
-        "ik/workflow-bundle": "dev-master"
+        "ik/workflow-bundle": "dev-master",
+        "php-amqplib/rabbitmq-bundle": "^1.12"
     },
     "require-dev": {
         "sensio/generator-bundle": "^3.0",

+ 147 - 7
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "content-hash": "f2078c9ad5a3d2f0d45b3bf0476da4ba",
+    "content-hash": "02da0e407d512618f1bb3fca37860c81",
     "packages": [
         {
             "name": "base-admin",
@@ -1281,9 +1281,10 @@
             "source": {
                 "type": "git",
                 "url": "ssh://git@200.50.168.30:222/VendorSoftwareFlowdat3/BaseOAuthClientBundle.git",
-                "reference": "d33a323d5e7bd94b560bf3826c2294c13c5cf75c"
+                "reference": "0118134e5c0a4731b2f54328a960756bb83ac32e"
             },
             "require": {
+                "ext-curl": "*",
                 "hwi/oauth-bundle": "^0.5.3"
             },
             "type": "library",
@@ -1299,7 +1300,7 @@
                 "bundle",
                 "oauth"
             ],
-            "time": "2017-04-05 15:29:56"
+            "time": "2017-04-06 15:40:13"
         },
         {
             "name": "ik/webservice-bundle",
@@ -1307,9 +1308,10 @@
             "source": {
                 "type": "git",
                 "url": "ssh://git@200.50.168.30:222/VendorSoftwareFlowdat3/Webservice.git",
-                "reference": "bd421c7eff1c9acd952e6c0c0776d754cf89e531"
+                "reference": "1c88fb658dfe9d8c9b5b15300d9754aaf2ecceaa"
             },
             "require": {
+                "ext-curl": "*",
                 "kriswallsmith/buzz": "~0.13"
             },
             "type": "library",
@@ -1319,7 +1321,7 @@
                 }
             },
             "description": "The Flowdat3 Webservice Rest",
-            "time": "2017-04-05 15:23:15"
+            "time": "2017-04-06 15:41:02"
         },
         {
             "name": "ik/workflow-bundle",
@@ -1327,7 +1329,10 @@
             "source": {
                 "type": "git",
                 "url": "ssh://git@200.50.168.30:222/VendorSoftwareFlowdat3/WorkflowBundle.git",
-                "reference": "3a0f4212ccca5907cb7f8d30812eba27180c8150"
+                "reference": "79de983588842b6f16e2436af260eacbf203d4be"
+            },
+            "require": {
+                "php-amqplib/rabbitmq-bundle": "^1.12"
             },
             "type": "library",
             "autoload": {
@@ -1354,7 +1359,7 @@
                 "bundle",
                 "workflow"
             ],
-            "time": "2017-04-05 14:30:12"
+            "time": "2017-04-07 13:32:10"
         },
         {
             "name": "incenteev/composer-parameter-handler",
@@ -2090,6 +2095,141 @@
             ],
             "time": "2017-03-13T16:27:32+00:00"
         },
+        {
+            "name": "php-amqplib/php-amqplib",
+            "version": "v2.6.3",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-amqplib/php-amqplib.git",
+                "reference": "fa2f0d4410a11008cb36b379177291be7ee9e4f6"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/fa2f0d4410a11008cb36b379177291be7ee9e4f6",
+                "reference": "fa2f0d4410a11008cb36b379177291be7ee9e4f6",
+                "shasum": ""
+            },
+            "require": {
+                "ext-bcmath": "*",
+                "ext-mbstring": "*",
+                "php": ">=5.3.0"
+            },
+            "replace": {
+                "videlalvaro/php-amqplib": "self.version"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^4.8",
+                "scrutinizer/ocular": "^1.1",
+                "squizlabs/php_codesniffer": "^2.5"
+            },
+            "suggest": {
+                "ext-sockets": "Use AMQPSocketConnection"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.7-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "PhpAmqpLib\\": "PhpAmqpLib/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "LGPL-2.1"
+            ],
+            "authors": [
+                {
+                    "name": "Alvaro Videla",
+                    "role": "Original Maintainer"
+                },
+                {
+                    "name": "John Kelly",
+                    "email": "johnmkelly86@gmail.com",
+                    "role": "Maintainer"
+                },
+                {
+                    "name": "Raúl Araya",
+                    "email": "nubeiro@gmail.com",
+                    "role": "Maintainer"
+                }
+            ],
+            "description": "Formerly videlalvaro/php-amqplib.  This library is a pure PHP implementation of the AMQP protocol. It's been tested against RabbitMQ.",
+            "homepage": "https://github.com/php-amqplib/php-amqplib/",
+            "keywords": [
+                "message",
+                "queue",
+                "rabbitmq"
+            ],
+            "time": "2016-04-11T14:30:01+00:00"
+        },
+        {
+            "name": "php-amqplib/rabbitmq-bundle",
+            "version": "v1.12.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-amqplib/RabbitMqBundle.git",
+                "reference": "0bb11edec0abdf6dc28eac0144c0a673dddba28f"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-amqplib/RabbitMqBundle/zipball/0bb11edec0abdf6dc28eac0144c0a673dddba28f",
+                "reference": "0bb11edec0abdf6dc28eac0144c0a673dddba28f",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.0",
+                "php-amqplib/php-amqplib": "~2.6",
+                "psr/log": "~1.0",
+                "symfony/config": "~2.3 || ~3.0",
+                "symfony/console": "~2.3 || ~3.0",
+                "symfony/dependency-injection": "~2.3 || ~3.0",
+                "symfony/event-dispatcher": "~2.3 || ~3.0",
+                "symfony/yaml": "~2.3 || ~3.0"
+            },
+            "replace": {
+                "oldsound/rabbitmq-bundle": "self.version"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.8 || ~5.0",
+                "symfony/debug": "~2.3 || ~3.0",
+                "symfony/serializer": "~2.3 || ~3.0"
+            },
+            "suggest": {
+                "symfony/framework-bundle": "To use this lib as a full Symfony Bundle and to use the profiler data collector"
+            },
+            "type": "symfony-bundle",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.10.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "OldSound\\RabbitMqBundle\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Alvaro Videla"
+                }
+            ],
+            "description": "Integrates php-amqplib with Symfony2|3 and RabbitMq. Formerly oldsound/rabbitmq-bundle.",
+            "keywords": [
+                "AMQP",
+                "Symfony2",
+                "message",
+                "queue",
+                "rabbitmq"
+            ],
+            "time": "2016-12-09T12:58:28+00:00"
+        },
         {
             "name": "phpcollection/phpcollection",
             "version": "0.5.0",