Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifest.jps
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 1.7
id: git-push-deploy
name: Git-Push-Deploy Add-On
homepage: https://www.virtuozzo.com/application-platform-docs/git-push-deploy/
baseUrl: https://cdn.jsdelivr.net/gh/jelastic-jps/git-push-deploy@master
baseUrl: https://raw.githubusercontent.com/sych74/git-push-deploy/refs/heads/JE-72978
description:
text: /text/description.md
short: Simple CI/CD pipeline for Git projects.
Expand Down
14 changes: 14 additions & 0 deletions scripts/redeploy.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//@req(token, action)
import com.hivext.api.server.system.service.utils.EnvironmentStatus;
if (token == "${TOKEN}") {
var targetEnv = "${TARGET_ENV}",
nodeGroup = "${NODE_GROUP}",
Expand All @@ -12,6 +13,19 @@
build = ${BUILD},
context = "${CONTEXT}";


var resp = jelastic.env.control.GetEnvInfo(envName, session);
if (resp.result != 0) return resp;
var status = resp.env.status;
var isEnvRunning = status == EnvironmentStatus['ENV_STATUS_TYPE_RUNNING'].getValue() ? true : false;

if (!isEnvRunning) {
if (jelastic.marketplace && jelastic.marketplace.console) {
jelastic.marketplace.console.WriteLog(appid, session, "GIT-PUSH-DEPLOY: environment is not running");
}
return { result: 0 };
}

if (action == 'redeploy') {
if (certified) {
return {result:99, error: 'redeploy action triggers automatically for certified containers', type: 'warning'};
Expand Down