BjornMagnussonXA | 9e5a42b | 2021-03-08 09:54:20 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # ============LICENSE_START=============================================== |
| 4 | # Copyright (C) 2021 Nordix Foundation. All rights reserved. |
| 5 | # ======================================================================== |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
| 17 | # ============LICENSE_END================================================= |
| 18 | # |
| 19 | |
| 20 | # Run the producer as a docker app |
| 21 | |
| 22 | print_err() { |
| 23 | echo "usage: local-run.sh local|local-secure" |
| 24 | } |
| 25 | |
| 26 | if [ $# -ne 1 ]; then |
| 27 | print_err |
| 28 | exit 1 |
| 29 | fi |
| 30 | |
| 31 | if [ $1 != "local" ] && [ $1 != "local-secure" ]; then |
| 32 | print_err |
| 33 | exit 1 |
| 34 | fi |
| 35 | |
| 36 | |
| 37 | . build_and_run_env.sh $1 |
| 38 | |
| 39 | cd app |
| 40 | |
| 41 | echo "When running in local mode - no callbacks from ECS or PMS are possible" |
| 42 | echo "local mode is only intended for debugging code that is not dependent of callbacks" |
| 43 | |
| 44 | echo "Starting on port: "$PORT |
| 45 | |
| 46 | python3 -u rproducer.py $PORT |