diff --git a/Dockerfile b/Dockerfile index d1378c0..06b9f0d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ LABEL maintainer="Predix Builder Relations" LABEL hub="https://hub.docker.com" LABEL org="https://hub.docker.com/u/predixedge" LABEL repo="predix-edge-ref-app" -LABEL version="1.0.44" +LABEL version="1.0.46" LABEL support="https://forum.predix.io" LABEL license="https://github.com/PredixDev/predix-docker-samples/blob/master/LICENSE.md" @@ -52,8 +52,8 @@ RUN rm -rf ./server RUN rm -rf ./src RUN rm -rf ./images -COPY ./scripts/entry_point.sh . +COPY ./scripts/entrypoint.sh . EXPOSE 5000 -ENTRYPOINT ["/usr/src/edge-ref-app/entry_point.sh"] +ENTRYPOINT ["/usr/src/edge-ref-app/entrypoint.sh"] diff --git a/README.md b/README.md index 92d4de6..8d73f01 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ If you are behind a corporate proxy server, use the proxy switches or remove the Change the version in the command below to match ```sh -docker build --no-cache --build-arg https_proxy --build-arg no_proxy= --build-arg http_proxy -t predixedge/predix-edge-ref-app:latest . +docker build --no-cache --build-arg https_proxy --build-arg no_proxy= --build-arg http_proxy -t predixedge/predix-edge-ref-app:<latest-version-here> . ``` ### Start the containers @@ -142,7 +142,7 @@ However, if one of the containers has a bug or an environmental problem it is qu There are a few tricks you can use to solve this. -### Trick #1 - add an entry_point.sh entry to the docker-compose. +### Trick #1 - add an entrypoint.sh entry to the docker-compose. ```sh entrypoint: ["sh", "-c", "sleep 500000"] @@ -280,13 +280,13 @@ docker login -u <username> -p <password> Build predix-edge-ref-app docker image using proxy. Change 'predixedge' to your Docker Organization which is usually your username. ```sh -docker build --no-cache -t predixedge/predix-edge-ref-app:latest --build-arg https_proxy --build-arg no_proxy= --build-arg http_proxy . +docker build --no-cache -t predixedge/predix-edge-ref-app:<latest-version-here> --build-arg https_proxy --build-arg no_proxy= --build-arg http_proxy . ``` Build predix-edge-ref-app docker image without proxy. Change 'predixedge' to your Docker Organization which is usually your username. ```sh -docker build --no-cache -t predixedge/predix-edge-ref-app:latest . +docker build --no-cache -t predixedge/predix-edge-ref-app:<latest-version-here> . ``` Now Push the docker image to the Docker Hub. diff --git a/config/app-deadband/env b/config/app-deadband/env index 4ec8c55..d9f20f0 100644 --- a/config/app-deadband/env +++ b/config/app-deadband/env @@ -1,5 +1,5 @@ #use bash format. -#ensure that 'source /config/env' is added to the container entry_point.sh file that needs it +#ensure that 'source /config/env' is added to the container entrypoint.sh file that needs it #export MYENVVAR=VALUE export HIGHHIGH="4" diff --git a/config/env b/config/env index 63931ec..86845dc 100644 --- a/config/env +++ b/config/env @@ -1,3 +1,3 @@ #use bash format. -#ensure that 'source /config/env' is added to the container entry_point.sh file that needs it -#export MYENVVAR=VALUE +#ensure that 'source /config/env' is added to the container entrypoint.sh file that needs it +export MYENVVAR=VALUE diff --git a/docker-compose-local.yml b/docker-compose-local.yml index a9024dd..634258a 100644 --- a/docker-compose-local.yml +++ b/docker-compose-local.yml @@ -40,7 +40,7 @@ services: ports: - 1880:1880 predix-edge-ref-app: - image: "predixedge/predix-edge-ref-app:1.0.44" + image: "predixedge/predix-edge-ref-app:1.0.46" volumes: - ./config:/config - ./data:/data diff --git a/docker-compose.yml b/docker-compose.yml index 778c538..e2f7546 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,7 +28,7 @@ services: ports: - 1880:1880 predix-edge-ref-app: - image: "predixedge/predix-edge-ref-app:1.0.44" + image: "predixedge/predix-edge-ref-app:1.0.46" networks: - predix-edge-broker_net ports: diff --git a/package-lock.json b/package-lock.json index 6e63361..4921c6f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "edge-ref-app", - "version": "1.0.44", + "version": "1.0.46", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 14c7f51..bbaee92 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "edge-ref-app", - "version": "1.0.44", + "version": "1.0.46", "description": "Predix Edge Reference app with node-red", "main": "server/app.js", "directories": { diff --git a/scripts/entry_point.sh b/scripts/entrypoint.sh similarity index 73% rename from scripts/entry_point.sh rename to scripts/entrypoint.sh index 2e961f4..d508dca 100755 --- a/scripts/entry_point.sh +++ b/scripts/entrypoint.sh @@ -3,4 +3,6 @@ cp /config/settings.js /data cp /config/flows.json /data cp /data/compressor-specs.json /data +source /config/env +ln -s /config testdir npm start diff --git a/scripts/quickstart-edge-ref-app-edgeos.sh b/scripts/quickstart-edge-ref-app-edgeos.sh index 366b190..dc07937 100755 --- a/scripts/quickstart-edge-ref-app-edgeos.sh +++ b/scripts/quickstart-edge-ref-app-edgeos.sh @@ -57,10 +57,11 @@ IZON_SH="https://raw.githubusercontent.com/PredixDev/izon/1.2.0/izon2.sh" #SCRIPT="-script build-basic-app.sh -script-readargs build-basic-app-readargs.sh" SCRIPT="-script edge-starter-deploy.sh -script-readargs edge-starter-deploy-readargs.sh" VERSION_JSON="version.json" +PREDIX_SCRIPTS_ORG="PredixDev" PREDIX_SCRIPTS=predix-scripts SCRIPT_NAME="quickstart-edge-ref-app-edgeos.sh" GITHUB_RAW="https://raw.githubusercontent.com" -GITHUB_ORG="adoption" +GITHUB_ORG="PredixDev" REPO_NAME="predix-edge-ref-app" APP_DIR="edge-ref-app-local" APP_NAME="Predix Edge Reference App - predix edgeos" diff --git a/scripts/quickstart-edge-ref-app-em.sh b/scripts/quickstart-edge-ref-app-em.sh index db514f0..acca169 100755 --- a/scripts/quickstart-edge-ref-app-em.sh +++ b/scripts/quickstart-edge-ref-app-em.sh @@ -48,18 +48,19 @@ function local_read_args() { BRANCH="master" PRINT_USAGE=0 SKIP_SETUP=false - -REPO_NAME=predix-edge-ref-app -IZON_SH="https://raw.githubusercontent.com/PredixDev/izon/1.2.0/izon2.sh" -SCRIPT="-script edge-manager.sh -script-readargs edge-manager-readargs.sh" -QUICKSTART_ARGS="$QUICKSTART_ARGS --create-packages --upload-application --upload-configuration --create-device -edge-app-name $REPO_NAME -asset-name Compressor-CMMS-Compressor-2018 $SCRIPT" +PREDIX_SCRIPTS_ORG="PredixDev" +PREDIX_SCRIPTS="predix-scripts" VERSION_JSON="version.json" -PREDIX_SCRIPTS=predix-scripts +GITHUB_RAW="https://raw.githubusercontent.com" +IZON_SH="https://raw.githubusercontent.com/PredixDev/izon/1.5.0/izon2.sh" +GITHUB_ORG="PredixDev" +REPO_NAME="predix-edge-ref-app" SCRIPT_NAME="quickstart-edge-ref-app-em.sh" -GITHUB_RAW="https://raw.githubusercontent.com/PredixDev" APP_DIR="edge-ref-app-local" APP_NAME="Predix Edge Reference App - edge manager" +SCRIPT="-script edge-manager.sh -script-readargs edge-manager-readargs.sh" +QUICKSTART_ARGS="$QUICKSTART_ARGS --create-packages --upload-application --upload-configuration --create-device -edge-app-name $REPO_NAME -asset-name Compressor-CMMS-Compressor-2018 $SCRIPT" TOOLS="Cloud Foundry CLI, Docker, Git, JQ, Node.js, Predix CLI, YQ" TOOLS_SWITCHES="--cf --docker --git --jq --nodejs --predixcli --yq" TIMESERIES_CHART_ONLY="true" @@ -68,8 +69,8 @@ TIMESERIES_CHART_ONLY="true" local_read_args $@ #variables after processing switches -SCRIPT_LOC="$GITHUB_RAW/$REPO_NAME/$BRANCH/scripts/$SCRIPT_NAME" -VERSION_JSON_URL=https://raw.githubusercontent.com/PredixDev/$REPO_NAME/$BRANCH/version.json +SCRIPT_LOC="$GITHUB_RAW/$GITHUB_ORG/$REPO_NAME/$BRANCH/scripts/$SCRIPT_NAME" +VERSION_JSON_URL=$GITHUB_RAW/$GITHUB_ORG/$REPO_NAME/$BRANCH/version.json #if [[ "$SKIP_PREDIX_SERVICES" == "false" ]]; then @@ -110,7 +111,7 @@ function init() { eval "$(curl -s -L $IZON_SH)" #curl -O $SCRIPT_LOC; chmod 755 $SCRIPT_NAME; getVersionFile - getLocalSetupFuncs $GITHUB_RAW + getLocalSetupFuncs $GITHUB_RAW $PREDIX_SCRIPTS_ORG } if [[ $PRINT_USAGE == 1 ]]; then diff --git a/scripts/quickstart-edge-ref-app-local.sh b/scripts/quickstart-edge-ref-app-local.sh index 3f00a95..eaed077 100755 --- a/scripts/quickstart-edge-ref-app-local.sh +++ b/scripts/quickstart-edge-ref-app-local.sh @@ -53,21 +53,18 @@ function local_read_args() { BRANCH="master" PRINT_USAGE=0 SKIP_SETUP=false - -IZON_SH="https://raw.githubusercontent.com/PredixDev/izon/develop/izon2.sh" -#ASSET_MODEL="-amrmd predix-ui-seed/server/sample-data/predix-asset/asset-model-metadata.json predix-ui-seed/server/sample-data/predix-asset/asset-model.json" -#SCRIPT="-script build-basic-app.sh -script-readargs build-basic-app-readargs.sh" -SCRIPT="-script edge-starter-deploy.sh -script-readargs edge-starter-deploy-readargs.sh" VERSION_JSON="version.json" PREDIX_SCRIPTS_ORG="PredixDev" PREDIX_SCRIPTS="predix-scripts" GITHUB_RAW="https://raw.githubusercontent.com" +IZON_SH="https://raw.githubusercontent.com/PredixDev/izon/1.5.0/izon2.sh" + GITHUB_ORG="PredixDev" REPO_NAME="predix-edge-ref-app" SCRIPT_NAME="quickstart-edge-ref-app-local.sh" APP_DIR="edge-ref-app-local" APP_NAME="Predix Edge Reference App - local" - +SCRIPT="-script edge-starter-deploy.sh -script-readargs edge-starter-deploy-readargs.sh" TOOLS="Cloud Foundry CLI, Docker, Git, jq, yq, Node.js, Predix CLI" TOOLS_SWITCHES="--cf --docker --git --jq --yq --nodejs --predixcli" diff --git a/scripts/quickstart-package.sh b/scripts/quickstart-package.sh index 97b32bd..33721e7 100755 --- a/scripts/quickstart-package.sh +++ b/scripts/quickstart-package.sh @@ -44,20 +44,19 @@ function local_read_args() { BRANCH="master" PRINT_USAGE=0 SKIP_SETUP=false - -IZON_SH="https://raw.githubusercontent.com/PredixDev/izon/1.4.0/izon2.sh" -SCRIPT="-script edge-manager.sh -script-readargs edge-manager-readargs.sh" -QUICKSTART_ARGS="$QUICKSTART_ARGS --create-packages --create-configuration -edge-app-name $REPO_NAME --skip-predix-services $SCRIPT" VERSION_JSON="version.json" -PREDIX_SCRIPTS_ORG="adotion" -PREDIX_SCRIPTS=predix-scripts - -SCRIPT_NAME="quickstart-package.sh" +PREDIX_SCRIPTS_ORG="PredixDev" +PREDIX_SCRIPTS="predix-scripts" GITHUB_RAW="https://raw.githubusercontent.com" +IZON_SH="https://raw.githubusercontent.com/PredixDev/izon/1.5.0/izon2.sh" + GITHUB_ORG="adoption" REPO_NAME="predix-edge-ref-app" APP_DIR="edge-ref-app-local" -APP_NAME="Predix Edge Reference App - edge manager" +APP_NAME="Predix Edge Reference App - package" +SCRIPT="-script edge-manager.sh -script-readargs edge-manager-readargs.sh" +QUICKSTART_ARGS="$QUICKSTART_ARGS --create-packages --create-configuration -edge-app-name $REPO_NAME --skip-predix-services $SCRIPT" +SCRIPT_NAME="quickstart-package.sh" TOOLS="Docker, Git, JQ, YQ" TOOLS_SWITCHES="--cf --docker --git --jq --nodejs --predixcli --yq" TIMESERIES_CHART_ONLY="true" diff --git a/version.json b/version.json index 2ad9e3b..4569a90 100644 --- a/version.json +++ b/version.json @@ -1,12 +1,12 @@ { "name": "Edge Ref App", - "version": "1.0.44", + "version": "1.0.46", "private": true, "dependencies": { "local-setup": "https://github.com/PredixDev/local-setup#1.0.106", "predix-scripts": "https://github.com/PredixDev/predix-scripts#1.1.229", - "predix-webapp-starter": "https://github.com/PredixDev/predix-webapp-starter.git#2.0.69", - "predix-edge-ref-app": "https://github.com/PredixDev/predix-edge-ref-app.git#1.0.44", + "predix-webapp-starter": "https://github.com/PredixDev/predix-webapp-starter.git#2.0.77", + "predix-edge-ref-app": "https://github.com/PredixDev/predix-edge-ref-app.git#1.0.46", "predix-edge-broker": "https://artifactory.predix.io/artifactory/PREDIX-EXT/predix-edge/2_1_0/os/predix-edge-broker-amd64-20180917-1.0.2.tar.gz#", "opcua": "https://artifactory.predix.io/artifactory/PREDIX-EXT/predix-edge/2_1_0/apps/adapters/predix-edge-opc-ua-adapter-amd64-20181002-1.1.0.tar.gz#", "cloud_gateway": "https://artifactory.predix.io/artifactory/PREDIX-EXT/predix-edge/2_1_0/apps/gateway/predix-edge-cloud-gateway-amd64-20181002-1.1.0.tar.gz#"