aboutsummaryrefslogtreecommitdiffstats
path: root/sdc-os-chef/scripts/docker_run.sh
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2018-08-13 13:27:52 +0300
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2018-08-15 04:57:48 +0000
commitdc856bba284798fa8f1484abf8fc8140008ececb (patch)
treed2c04a049fe2b5f1420cd02a545bce1109c46134 /sdc-os-chef/scripts/docker_run.sh
parent57f4bfa334d91b445e1999a5504fda4f43d0a1e4 (diff)
maven improvements and clean up
update plugging to latest available versions, remove un needed files from source control clean up commented sections. disable verbose for docker plug in. add logback file for tests to disable out put by default. update logging calls to new api. disable logging on debug level. update docker run to include simulator on demand Change-Id: Icc0fb7add6dd4fe65f5f3d8dd309fd8dae2681fc Issue-ID: SDC-1639 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'sdc-os-chef/scripts/docker_run.sh')
-rwxr-xr-xsdc-os-chef/scripts/docker_run.sh64
1 files changed, 51 insertions, 13 deletions
diff --git a/sdc-os-chef/scripts/docker_run.sh b/sdc-os-chef/scripts/docker_run.sh
index f1a6ee4939..bb6d6005d3 100755
--- a/sdc-os-chef/scripts/docker_run.sh
+++ b/sdc-os-chef/scripts/docker_run.sh
@@ -45,8 +45,12 @@ fi
function usage {
- echo "usage: docker_run.sh [ -r|--release <RELEASE-NAME> ] [ -e|--environment <ENV-NAME> ] [ -p|--port <Docker-hub-port>] [ -l|--local <Run-without-pull>] [ -t|--runTests <Run-with-sanityDocker>] [ -dcae|--dcae <Run-with-DCAE>][ -h|--help ]"
- echo "example: sudo bash docker_run.sh -e AUTO -r 1.2-STAGING-latest -dcae"
+ echo "usage: docker_run.sh [ -r|--release <RELEASE-NAME> ] [ -e|--environment <ENV-NAME> ] [ -p|--port <Docker-hub-port>] [ -l|--local <Run-without-pull>] [ -t|--runTests <Run-with-sanityDocker>] [ -sim|--simulator <Run-with-simulator>] [ -ta <run api tests with the supplied test suit>] [ -tu <run ui tests with the supplied test suit>] [ -ta <run api tests with the supplied test suit>] [ -tu <run ui tests with the supplied test suit>] [ -tad <run api tests with the default test suit>] [ -tu <run ui tests with the default test suit>] [ -dcae|--dcae <Run-with-DCAE>][ -h|--help ]"
+ echo "start dockers built locally example: docker_run.sh -l"
+ echo "start dockers built locally and simulator example: docker_run.sh -l -sim"
+ echo "start dockers, pull from onap nexus according to release and simulator example: docker_run.sh -r 1.3-STAGING-latest -sim"
+ echo "start dockers built locally and run api tests docker example: docker_run.sh -l -tad"
+ echo "start dockers built locally and run only the catalog be example: docker_run.sh -l -d sdc-BE "
}
#
@@ -180,6 +184,18 @@ function probe_dcae_tools {
}
#
+# check simulator status
+function probe_sim {
+ if lsof -Pi :8285 -sTCP:LISTEN -t >/dev/null ; then
+ echo "running"
+ sim_stat=true
+ else
+ echo "not running"
+ sim_stat=false
+ fi
+}
+#
+
function monitor_docker {
DOCKER_NAME=$1
@@ -538,7 +554,7 @@ function sdc-ui-tests {
if [ ${LOCAL} = false ]; then
docker pull ${PREFIX}/sdc-ui-tests:${RELEASE}
fi
-
+ RUN_SIMULATOR=true;
sdc-sim
docker run --detach --name sdc-ui-tests --env HOST_IP=${IP} --env ENVNAME="${DEP_ENV}" --env JAVA_OPTIONS="${UI_TESTS_JAVA_OPTIONS}" --env SUITE_NAME=${UI_SUITE} --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 ${LOCAL_TIME_MOUNT_CMD} --volume ${WORKSPACE}/data/logs/sdc-ui-tests/target:/var/lib/tests/target --volume ${WORKSPACE}/data/logs/sdc-ui-tests/ExtentReport:/var/lib/tests/ExtentReport --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --publish 5901:5901 --publish 6901:6901 ${PREFIX}/sdc-ui-tests:${RELEASE}
echo "please wait while SDC-UI-TESTS is starting....."
@@ -551,16 +567,29 @@ function sdc-ui-tests {
# SDC-Simulator
function sdc-sim {
- echo "docker run sdc-webSimulator..."
- if [ ${LOCAL} = false ]; then
- docker pull ${PREFIX}/sdc-simulator:${RELEASE}
- fi
+ if [ ${RUN_SIMULATOR} = true ]; then
+ echo "docker run sdc-webSimulator..."
+ if [ ${LOCAL} = false ]; then
+ docker pull ${PREFIX}/sdc-simulator:${RELEASE}
+ fi
- probe_sim
- if [ sim_stat=false ]; then
- docker run --detach --name sdc-sim --env JAVA_OPTIONS="${SIM_JAVA_OPTIONS}" --env ENVNAME="${DEP_ENV}" ${LOCAL_TIME_MOUNT_CMD} --volume ${WORKSPACE}/data/logs/WS/:/var/lib/jetty/logs --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --publish 8285:8080 --publish 8286:8443 ${PREFIX}/sdc-simulator:${RELEASE}
- echo "please wait while SDC-WEB-SIMULATOR is starting....."
- monitor_docker sdc-sim
+ probe_sim
+ sim_stat=$?
+ if [ sim_stat=1 ]; then
+ docker run \
+ --detach \
+ --name sdc-sim \
+ --env FE_URL="${FE_URL}" \
+ --env JAVA_OPTIONS="${SIM_JAVA_OPTIONS}" \
+ --env ENVNAME="${DEP_ENV}" \
+ ${LOCAL_TIME_MOUNT_CMD} \
+ --volume ${WORKSPACE}/data/logs/WS/:/var/lib/jetty/logs \
+ --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments \
+ --publish 8285:8080 \
+ --publish 8286:8443 ${PREFIX}/sdc-simulator:${RELEASE}
+ echo "please wait while SDC-WEB-SIMULATOR is starting....."
+ monitor_docker sdc-sim
+ fi
fi
}
#
@@ -628,7 +657,15 @@ while [ $# -gt 0 ]; do
shift 1 ;
DOCKER=$1;
shift 1 ;;
-
+ # -sim | --simulator run the simulator
+ -sim | --simulator )
+ RUN_SIMULATOR=true;
+ shift 1 ;;
+ # -sim | --simulator run the simulator
+ -u | --fe_url )
+ shift 1 ;
+ FE_URL=$1;
+ shift 1 ;;
# -dcae | --dcae - Use this to deploy DCAE upon SDC
-dcae | --dcae )
shift 1 ;
@@ -684,6 +721,7 @@ if [ -z "${DOCKER}" ]; then
dcae-tools
dcae-fe
healthCheck
+ sdc-sim
sdc-api-tests
sdc-ui-tests
else
/a> 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708