This repository has been archived by the owner on Mar 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
We have no control on the environment name length #9
Comments
Here's how to reproduce the issue:
jpsVersion: 1.3
jpsType: install
application:
id: shopozor-management-frontend-e2e
name: shopozor-management-frontend-e2e
version: 0.0
env:
topology:
nodes:
- nodeGroup: cp
image: softozor/shopozor-mgmt-frontend-e2e:latest
displayName: Application servers
count: 1
fixedCloudlets: 4
cloudlets: 10
skipNodeEmails: true
#!/bin/bash
if [ $# -lt 5 ] ; then
echo "Usage: $0 hosterUrl appId login password envName [deploy_group = cp] [path-to-manifest = e2e.jps]"
exit 0
fi
CONTENT_TYPE="Content-Type: application/x-www-form-urlencoded; charset=UTF-8;"
USER_AGENT="Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)"
getSession() {
local login=$1
local password=$2
local hosterUrl=$3
echo "Signing in..." >&2
local cmd=$(curl -k -H "${CONTENT_TYPE}" -A "${USER_AGENT}" -X POST \
-fsS "$hosterUrl/1.0/users/authentication/rest/signin" -d "login=$login&password=$password");
echo "Signed in" >&2
echo $(jq '.session' <<< $cmd | sed 's/\"//g')
}
getEnvs() {
local session=$1
echo "Getting environments..." >&2
local cmd=$(curl -k \
-H "${CONTENT_TYPE}" \
-A "${USER_AGENT}" \
-X POST \
-fsS ${HOSTER_URL}/1.0/environment/control/rest/getenvs -d "appid=${APPID}&session=${session}")
echo "Got environments" >&2
echo $cmd
}
installEnv() {
local session=$1
local envName=$2
local pathToManifest=$3
local manifest=$(cat $pathToManifest)
echo "Installing new environment <$envName> from manifest <$pathToManifest>..." >&2
local cmd=$(curl -k \
-A "${USER_AGENT}" \
-H "${CONTENT_TYPE}" \
-X POST -fsS ${HOSTER_URL}"/1.0/development/scripting/rest/eval" \
--data "session=${session}&shortdomain=${envName}&envName=${envName}&script=InstallApp&appid=appstore&type=install&charset=UTF-8" --data-urlencode "manifest=$manifest")
echo "Installation result: $cmd" >&2
echo "Environment <$envName> installed" >&2
}
HOSTER_URL=$1
APPID=$2
SESSION=$(getSession $3 $4 ${HOSTER_URL})
ENV_NAME=$5
DEPLOY_GROUP=${6:-cp}
MANIFEST=${7:-e2e.jps}
runE2e() {
ENVS=$(getEnvs $SESSION)
installEnv $SESSION "${ENV_NAME}" "$MANIFEST"
exit 0
}
runE2e and run ./run-e2e.sh "jelasticProviderUrl" "appId" "login" "password" "shopozor-management-frontend-e2e" "cp" "e2e.jps" where jpsVersion: 1.3
jpsType: update
application:
id: shopozor-management-frontend-e2e
name: shopozor-management-frontend-e2e
version: 0.0
globals:
NODEJS_HOME: /home/node
onInstall:
- test
actions:
test:
- cmd [cp]:
- cd ${globals.NODEJS_HOME}
- rm -Rf junit-reports cypress/videos cypress/screenshots
- yarn start:e2e I get in that case this error: {
"result":1704,
"debug": {
"cpu": {
"usage":"3",
"time":491
},
"time":803
},
"response":null,
"source":"hx-core",
"error":"org.mozilla.javascript.JavaScriptException: Error: checkRights().GetAppPermission: {\"result\":901,\"source\":\"hx-core\",\"error\":\"application [shopozor-management-frontend-e2e] not exist\"}"
} However,
jpsVersion: 1.3
jpsType: install
application:
id: shopozor-mgmt-frontend-e2e
name: shopozor-mgmt-frontend-e2e
version: 0.0
env:
topology:
nodes:
- nodeGroup: cp
image: softozor/shopozor-mgmt-frontend-e2e:latest
displayName: Application servers
count: 1
fixedCloudlets: 4
cloudlets: 10
skipNodeEmails: true
./run-e2e.sh "jelasticProviderUrl" "appId" "login" "password" "shopozor-mgmt-frontend-e2e" "cp" "e2e.jps" where jpsVersion: 1.3
jpsType: update
application:
id: shopozor-mgmt-frontend-e2e
name: shopozor-mgmt-frontend-e2e
version: 0.0
globals:
NODEJS_HOME: /home/node
onInstall:
- test
actions:
test:
- cmd [cp]:
- cd ${globals.NODEJS_HOME}
- rm -Rf junit-reports cypress/videos cypress/screenshots
- yarn start:e2e Then everything is fine. |
Ticket "JE-49193 - [CS:Install] - incorrect behavior for envName with length=32" is open at Jelastic. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Various tests on our CI/CD server showed that the environment name
shopozor-management-frontend-e2e
prevents it from running the e2e tests, i.e. it is not possible to install the e2e manifest even though the installation manifest was successfully installed.One way to prevent that problem from happening would be to set a maximal length for the frontend environment names in the shopozor ci manifest's settings section. That functionality is, however, not supported yet (ticket 12056).
The text was updated successfully, but these errors were encountered: