Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Je 56110 #19

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
7 changes: 5 additions & 2 deletions manifest.jps
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,11 @@ actions:
targetEnv: ${env.envName}

delete-redeploy-script:
- jelastic.dev.scripting.DeleteScript:
name: ${env.envName}-${globals.scriptName}
- script: |
return api.dev.scripting.DeleteScript({
appid: api.dev.apps.CreatePersistence ? "${env.appid}" : appid,
name: "${env.envName}-${globals.scriptName}"
});
- web-hook:
act: delete
- if (nodes.build):
Expand Down
7 changes: 4 additions & 3 deletions scripts/create-redeploy-script.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.hivext.api.utils.Random;

var buildEnv = "${env.envName}";
var targetAppid = api.dev.apps.CreatePersistence ? "${env.appid}" : appid;

//reading script from URL
var scriptBody = new Transport().get(url)
Expand Down Expand Up @@ -72,10 +73,10 @@

var scriptName = "${env.envName}-${globals.scriptName}";
//delete the script if it exists already
jelastic.dev.scripting.DeleteScript(scriptName);
api.dev.scripting.DeleteScript(targetAppid, session, scriptName);

//create a new script
var resp = jelastic.dev.scripting.CreateScript(scriptName, 'js', scriptBody);
var resp = jelastic.dev.scripting.CreateScript(targetAppid, session, scriptName, 'js', scriptBody);
if (resp.result != 0) return resp;

//get app host
Expand All @@ -87,7 +88,7 @@
call : {
procedure : next,
params : {
appid : appid,
appid : targetAppid,
host : host,
token : token
}
Expand Down