Skip to content

Commit

Permalink
3.4.3 fixed issue with OK green status in pipelines (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
Richi authored Jun 24, 2024
1 parent cb25bbc commit 1a03df4
Show file tree
Hide file tree
Showing 10 changed files with 900 additions and 471 deletions.
2 changes: 1 addition & 1 deletion dist/bratiska-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const tag_1 = require("./tag");
const label_1 = require("./label");
const common_1 = require("./common");
const helpers = __importStar(require("./helpers"));
const version = "3.4.2";
const version = "3.4.3";
const deploy = new deploy_1.Deploy();
const tag = new tag_1.Tag();
const common = new common_1.Common();
Expand Down
12 changes: 0 additions & 12 deletions dist/build_image.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,51 +18,39 @@ class BuildImage {
check_docker_file(options) {
(0, check_docker_file_1.check_docker_file)(options);
}

check_docker(options) {
(0, check_docker_1.check_docker)(options);
}

check_docker_login(options) {
(0, check_docker_login_1.check_docker_login)(options);
}

check_docker_running(options) {
(0, check_docker_running_1.check_docker_running)(options);
}

check_bratiska_build_envs(options) {
(0, check_bratiska_build_envs_1.check_bratiska_build_envs)(options);
}

check_docker_ignore(options) {
(0, check_docker_ignore_1.check_docker_ignore)(options);
}

build_docker_image(options) {
(0, build_docker_image_1.build_docker_image)(options);
}

check_docker_image(options) {
(0, check_docker_image_1.check_docker_image)(options);
}

clean_bratiska_build_envs(options) {
(0, clean_bratiska_build_envs_1.clean_bratiska_build_envs)(options);
}

push_docker_image(options) {
(0, push_docker_image_1.push_docker_image)(options);
}

check_pushed_image(options) {
(0, check_pushed_image_1.check_pushed_image)(options);
}

clean_docker_image(options) {
(0, clean_docker_image_1.clean_docker_image)(options);
}

check_build_image_commands(options) {
(0, check_build_image_commands_1.check_build_image_commands)(options);
}
Expand Down
3 changes: 2 additions & 1 deletion dist/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ function kubectl_deploy_status_utf8(kind, options) {
exports.kubectl_deploy_status_utf8 = kubectl_deploy_status_utf8;
function kubectl_deploy_events(kind, options) {
helpers.log(chalk_1.default.reset(""));
const cmd = `kubectl get events --namespace=${options.namespace} --sort-by='.metadata.creationTimestamp' | grep -i ${options.deployment}-${helpers.kind_to_app(kind)}`;
const cmd = `kubectl get events --request-timeout=180s --namespace=${options.namespace} --sort-by='.metadata.creationTimestamp' | grep -i ${options.deployment}-${helpers.kind_to_app(kind)}`;
helpers.print_if_debug(options, `kubectl deploy logs: ${cmd}`);
(0, child_process_1.execSync)(cmd, {
stdio: "inherit"
Expand Down Expand Up @@ -495,6 +495,7 @@ function kubectl_get_latest_pod(kind, options) {
"-l",
`app=${options.deployment},service=${helpers.kind_to_app(kind)}`,
`--namespace=${options.namespace}`,
`--request-timeout=30s`,
`--sort-by=.metadata.creationTimestamp`,
`-o`,
`jsonpath='{.items[-1:].metadata.name}'`
Expand Down
20 changes: 10 additions & 10 deletions dist/common/check_git_repo_name.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = {
enumerable: true, get: function() {
return m[k];
}
};
desc = {
enumerable: true, get: function() {
return m[k];
}
};
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
Expand Down Expand Up @@ -38,8 +38,8 @@ function check_git_repo_name(options) {
return;
}
const name_bash = commands.git_repo_name(options);
if (name_bash === "") {
throw new Error("There was an issue fetching git repo name from git origin!");
if (name_bash === "") {
throw new Error("There was an issue fetching git repo name from git origin!");
}
options.repo_name = name_bash;
helpers.print_if_debug(options, `reponame: ${options.repo_name}`);
Expand All @@ -55,9 +55,9 @@ function check_git_repo_name(options) {
throw Error(`You have repository name mismatch. Git repo name: ${options.repo_name} != package.json name: ${options.deployment}. Please fix the names, that they match with the repository name and project.json name.`);
}
const repository_bash = commands.git_repository_url();
helpers.print_if_debug_bash(options, "repository_bash", repository_bash);
if (repository_bash.err !== "") {
throw new Error("There was an issue getting the remote repository URL. Please push your changes to GitHub or azure.\n");
helpers.print_if_debug_bash(options, "repository_bash", repository_bash);
if (repository_bash.err !== "") {
throw new Error("There was an issue getting the remote repository URL. Please push your changes to GitHub or azure.\n");
}
options.repository_uri = repository_bash.res;
helpers.print_if_debug(options, `repository_uri: ${options.repository_uri}`);
Expand Down
4 changes: 3 additions & 1 deletion dist/deploy/check_deployment.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ function check_deployment(options) {
helpers.line(`\n(${helpers.step(options)}) Showing kubernetes logs for pod ${pod}:...`);
try {
commands.kubectl_get_log_for_pod(pod, options);
console.error(`\n Deploy was not successfully rolled out. Check logs above.`);
process.exit(1);
} catch (e) {
throw Error(`Exiting bratiska-cli with status code 1, because deploy was not successfully rolled out in kubernetes. Check pod ${pod} log in grafana.bratislava.sk or directly in kubernetes.`);
throw Error(`Exiting bratiska-cli with status code 1, because deploy was not successfully rolled out in kubernetes. Check pod ${pod} logs in grafana.bratislava.sk or directly in kubernetes.`);
}
}
helpers.finished();
Expand Down
Loading

0 comments on commit 1a03df4

Please sign in to comment.