elastic / elastic/cloudbeat

Lint `deploy/` shell scripts with shellcheck

Open
#1,364 4 comments 1 reaction 1 assignee Assigned to @Copilot View on GitHub
cloudbeat good first issue Team:Cloud Security technical debt
Dominant language
Go
Stars
58
Forks
55
Avg merge
9h 9m
Merged PRs (30d)
424

Description

**Motivation**
[Shellcheck](https://www.shellcheck.net/) is a very popular shell script linter, its usage is recommended as a best practice when developing shell scripts.

Expand the shellcheck linter usage to other scripts in our repo, especially the ones that are used by users, like [deploy.sh](https://github.com/elastic/cloudbeat/blob/main/deploy/deployment-manager/deploy.sh).

For example, one potential problem I see in that script is that the `set -e` option is not set which means that the script will continue even when commands start failing. But, enabling that option is not enough because we are affected by rule [SC2155](https://www.shellcheck.net/wiki/SC2155) in our variable exports.

**Definition of done**
What needs to be completed at the end of this task
- [ ] Expand pre-commit file regex to include more files
- [ ] Evaluate and fix or ignore failures

**Related tasks/epics**
Shellcheck introduced in https://github.com/elastic/cloudbeat/pull/1357

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.