From 392cca7a80edc84824d6521e85b54f693765bd60 Mon Sep 17 00:00:00 2001 From: Rohan Patel Date: Mon, 30 Sep 2019 17:01:25 -0400 Subject: [PATCH] added updated code for test env Change-Id: I099e51de42ae531897b3f959df601045e108e791 Signed-off-by: Rohan Patel --- otf-camunda/docker/Dockerfile | 6 +- otf-camunda/pom.xml | 6 +- otf-frontend/Dockerfile | 2 +- otf-frontend/package.json | 2 +- .../services/bpmn-validate/bpmn-validate.class.js | 2 +- .../src/feathers/services/jobs/jobs.hooks.js | 4 +- otf-installation.txt | 67 +++++++ otf-robot-test-head/Dockerfile | 3 +- otf-service-api/docker/Dockerfile | 2 +- otf-service-api/pom.xml | 2 +- settings.xml | 215 +++++++++++++++++++++ 11 files changed, 297 insertions(+), 14 deletions(-) create mode 100644 otf-installation.txt create mode 100644 settings.xml diff --git a/otf-camunda/docker/Dockerfile b/otf-camunda/docker/Dockerfile index 4df636c..d63564e 100644 --- a/otf-camunda/docker/Dockerfile +++ b/otf-camunda/docker/Dockerfile @@ -7,10 +7,10 @@ ENV EXECUTORS_ACTIVE=true ENV OTF_MONGO_USERNAME=username ENV OTF_MONGO_PASSWORD=password ENV OTF_MONGO_HOSTS=localhost:27017 -ENV OTF_MONGO_REPLICASET=mongoOTF +ENV OTF_MONGO_REPLICASET=rs0 ENV OTF_MONGO_DATABASE=otf -ENV OTF_CAMUNDA_DB_URL=localhost:3306/otf-camunda -ENV OTF_CAMUNDA_DB_USERNAME=username +ENV OTF_CAMUNDA_DB_URL=localhost:3306/camunda +ENV OTF_CAMUNDA_DB_USERNAME=root ENV OTF_CAMUNDA_DB_PASSWORD=password ENV AAF_PERM_TYPE=type ENV CADI_HOSTNAME=localhost diff --git a/otf-camunda/pom.xml b/otf-camunda/pom.xml index 4fa0994..ad4deb3 100644 --- a/otf-camunda/pom.xml +++ b/otf-camunda/pom.xml @@ -74,7 +74,7 @@ org.camunda.bpm.springboot - camunda-bpm-spring-boot-starter-webapp-ee + camunda-bpm-spring-boot-starter-webapp ${camunda.springboot.version} @@ -292,12 +292,12 @@ 2.1.10 registry.hub.docker.io - 7.10.0-ee + 7.10.0 2.0-alpha2 7.10.0 1.1.0 2.1.2 - 7.10.4-ee + 7.10.4 1.1.1 3.2.1 1.6.6 diff --git a/otf-frontend/Dockerfile b/otf-frontend/Dockerfile index a3fd845..6caf80d 100644 --- a/otf-frontend/Dockerfile +++ b/otf-frontend/Dockerfile @@ -16,7 +16,7 @@ ENV CAMUNDAAPI_AAFID=username ENV CAMUNDAAPI_AAFPASSWORD=password ENV MONGO_BASEURL=localhost:27017/ ENV MONGO_DBOTF=otf -ENV MONGO_REPLICASET=mongoOTF +ENV MONGO_REPLICASET=rs0 ENV MONGO_USERNAME=username ENV MONGO_PASSWORD=password diff --git a/otf-frontend/package.json b/otf-frontend/package.json index 84fa16d..2971bcb 100644 --- a/otf-frontend/package.json +++ b/otf-frontend/package.json @@ -25,7 +25,7 @@ "test-ci": "TEST_CI=true ng test", "lint": "ng lint", "e2e": "ng e2e", - "postinstall": "ng add ng-cli-pug-loader@0.1.7 && node ./ng-add-pug-loader.js" + "postinstall": "ng add ng-cli-pug-loader@0.1.7" }, "directories": { "lib": "server/src/feathers" diff --git a/otf-frontend/server/src/feathers/services/bpmn-validate/bpmn-validate.class.js b/otf-frontend/server/src/feathers/services/bpmn-validate/bpmn-validate.class.js index 8b969bc..d855145 100644 --- a/otf-frontend/server/src/feathers/services/bpmn-validate/bpmn-validate.class.js +++ b/otf-frontend/server/src/feathers/services/bpmn-validate/bpmn-validate.class.js @@ -249,7 +249,7 @@ class Service { } }; let options = { - url: 'https://localhost/' + this.options.app.get('base-path') + 'file-transfer', + url: this.options.app.get('otf').url + this.options.app.get('base-path') + 'file-transfer', headers: { 'Authorization': params.headers.Authorization, 'Content-Type': "multipart/form-data" diff --git a/otf-frontend/server/src/feathers/services/jobs/jobs.hooks.js b/otf-frontend/server/src/feathers/services/jobs/jobs.hooks.js index f119833..eec6d19 100644 --- a/otf-frontend/server/src/feathers/services/jobs/jobs.hooks.js +++ b/otf-frontend/server/src/feathers/services/jobs/jobs.hooks.js @@ -119,7 +119,7 @@ module.exports = { (context) => { console.log("AFTER PERMISSIONS")}, canExecute(), async (context) => { - const fullUrl = 'https://localhost/' + context.app.get('base-path') + 'schedule-test'; + const fullUrl = this.options.app.get('otf').url + context.app.get('base-path') + 'schedule-test'; context.data.executorId = context.params.user._id; @@ -155,7 +155,7 @@ module.exports = { permissions('jobs'), canExecute(), async function (context) { - const fullUrl = 'https://localhost/' + context.app.get('base-path') + 'cancel-test'; + const fullUrl = this.options.app.get('otf').url + context.app.get('base-path') + 'cancel-test'; if (context.id == null || context.params.user._id == null || utils.isValidObjectId(context.id) || utils.isValidObjectId(context.params.user._id)) { diff --git a/otf-installation.txt b/otf-installation.txt new file mode 100644 index 0000000..f40437b --- /dev/null +++ b/otf-installation.txt @@ -0,0 +1,67 @@ +docker login nexus3.onap.org:10001 + docker | docker + +APP PORT MAPPINGS Internal-k8s External-k8s Docker +otf-frontend 443 32524 8082 +otf-service-api 8443 32303 8081 +otf-camunda 8443 31313 8080 +otf-ping-test-head 5000 32223 5001 +otf-ssh-test-head 5000 32222 5002 +otf-robot-test-head 5000 32224 5003 + +otf-ping-test-head + comment app.run for ssl + uncomment app.run without ssl + change port if needed + docker build -t otf-ping-test-head:0.0.1-SNAPSHOT . + docker run -d --network="host" otf-ping-test-head:0.0.1-SNAPSHOT + +otf-ssh-test-head + comment app.run for ssl + uncomment app.run without ssl + change port if needed + docker build -t otf-ssh-test-head:0.0.1-SNAPSHOT . + docker run -d --network="host" otf-ssh-test-head:0.0.1-SNAPSHOT + +otf-robot-test-head + comment app.run for ssl + uncomment app.run without ssl + change port if needed + docker build -t otf-robot-test-head:0.0.1-SNAPSHOT . + docker run -d --network="host" otf-robot-test-head:0.0.1-SNAPSHOT + + +otf-frontend + + +otf-service-api + Modify src/main/resources/application.properties according to needs (disable aaf/ssl, set ports) + Add settings.xml from onap website and add profile to use maven default repository and add settings.xml to ~/.m2/ if missing + mvn clean install (add flag -DskipTests if it causes the build to fail) + navigate to target folder and run "docker build -t otf-service-api:0.0.1-SNAPSHOT ." + docker run -d --network="host" otf-service-api:0.0.1-SNAPSHOT + + +otf-camunda + Modify src/main/resources/application.yaml according to needs, and validate the yaml is correct format (disable aaf/ssl, set ports) + Add settings.xml from onap website and add profile to use maven default repository and add settings.xml to ~/.m2/ if missing + mvn clean install (add flag -DskipTests if it causes the build to fail) + navigate to target folder and run "docker build -t otf-camunda:0.0.1-SNAPSHOT ." + docker run -d --network="host" otf-camunda:0.0.1-SNAPSHOT + +Database Notes + run sudo installdbs.sh and export PATH=/usr/local/mysql/bin:$PATH to add mysql commands to path + run sudo createMongoUser.sh + edit mongo to create a replica set by modifying replication and net fields on file /etc/mongod.conf + add security: authorization: 'enabled' + after script is ran mysql should be able to be used, connect to mysql using the password set by script and mysql command and + alter the root password + alter user 'root'@'localhost' identified by 'new_password' + grant root ability to connect remotely + grant all on *.* to 'root'@'%' identified by 'password' + create db and exit mysql shell + create database 'new_db' + create tables using mysql scripts + mysql -u root -p db < engine.sql + mysql -u root -p db < identity.sql + diff --git a/otf-robot-test-head/Dockerfile b/otf-robot-test-head/Dockerfile index 95b7c2b..ce801b7 100644 --- a/otf-robot-test-head/Dockerfile +++ b/otf-robot-test-head/Dockerfile @@ -10,9 +10,10 @@ ENV APP_NAME=otf-robot-test-head ENV APP_VERSION=1.0 ENV OTF_MONGO_HOSTS=localhost:27017/ ENV OTF_MONGO_DATABASE=otf -ENV OTF_MONGO_REPLICASET=mongoOTF +ENV OTF_MONGO_REPLICASET=rs0 ENV OTF_MONGO_USERNAME=username ENV OTF_MONGO_PASSWORD=password +ENV APP_SETTINGS=app.configuration.DevelopmentConfiguration RUN python --version diff --git a/otf-service-api/docker/Dockerfile b/otf-service-api/docker/Dockerfile index e0e9e53..d1ef755 100644 --- a/otf-service-api/docker/Dockerfile +++ b/otf-service-api/docker/Dockerfile @@ -12,7 +12,7 @@ ENV APP_VERSION=1.0 ENV OTF_MONGO_HOSTS=localhost:27017 ENV OTF_MONGO_USERNAME=username ENV OTF_MONGO_PASSWORD=password -ENV OTF_MONGO_REPLICASET=mongoOTF +ENV OTF_MONGO_REPLICASET=rs0 ENV OTF_MONGO_DATABASE=otf ENV otf.camunda.host=https://localhost ENV otf.camunda.port=31313 diff --git a/otf-service-api/pom.xml b/otf-service-api/pom.xml index fda9ed3..46b4b21 100644 --- a/otf-service-api/pom.xml +++ b/otf-service-api/pom.xml @@ -302,7 +302,7 @@ httpmime org.apache.httpcomponents - 4.5.7-SNAPSHOT + 4.5.7 diff --git a/settings.xml b/settings.xml new file mode 100644 index 0000000..5a4325d --- /dev/null +++ b/settings.xml @@ -0,0 +1,215 @@ + + + /home/YOURUSERID/onap/.m2/repository + + + + openecomp-staging + + + openecomp-staging + openecomp-staging + https://nexus.onap.org/content/repositories/staging/ + + true + never + + + false + + + + + + openecomp-staging + openecomp-staging + https://nexus.onap.org/content/repositories/staging/ + + true + never + + + false + + + + + + openecomp-public + + + openecomp-public + openecomp-public + https://nexus.onap.org/content/repositories/public/ + + true + never + + + false + + + + + + openecomp-public + openecomp-public + https://nexus.onap.org/content/repositories/public/ + + true + never + + + false + + + + + + openecomp-release + + + openecomp-release + openecomp-release + https://nexus.onap.org/content/repositories/releases/ + + true + never + + + false + + + + + + openecomp-release + openecomp-release + https://nexus.onap.org/content/repositories/releases/ + + true + never + + + false + + + + + + + openecomp-snapshots + + + openecomp-snapshot + openecomp-snapshot + https://nexus.onap.org/content/repositories/snapshots/ + + false + + + true + + + + + + openecomp-snapshot + openecomp-snapshot + https://nexus.onap.org/content/repositories/snapshots/ + + false + + + true + + + + + + opendaylight-release + + + opendaylight-mirror + opendaylight-mirror + https://nexus.opendaylight.org/content/repositories/public/ + + true + never + + + false + + + + + + opendaylight-mirror + opendaylight-mirror + https://nexus.opendaylight.org/content/repositories/public/ + + true + never + + + false + + + + + + + opendaylight-snapshots + + + opendaylight-snapshot + opendaylight-snapshot + https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ + + false + + + true + + + + + + opendaylight-snapshot + opendaylight-snapshot + https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ + + false + + + true + + + + + + + default + + + default + default + https://repo.maven.org/maven2/ + + + + + + + + default + openecomp-staging + openecomp-public + openecomp-release + openecomp-snapshots + opendaylight-release + opendaylight-snapshots + + -- 2.16.6