Skip to content

Commit

Permalink
Merge pull request #176 from wazuh/bug/175-revert-changes-in-ova-work…
Browse files Browse the repository at this point in the history
…flow-to-add-support-in-stages

Fix the ova workflow for stages support and AWS instance deletion
  • Loading branch information
c-bordon authored Jan 27, 2025
2 parents d481cad + 29901ff commit 8e2f084
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/builder_OVA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,5 +216,5 @@ jobs:
echo "S3 sha512 OVA URI: ${s3uri}"
- name: Delete allocated VM
if: always() && steps.alloc_vm == 'success'
if: always() && steps.alloc_vm.outcome == 'success'
run: python3 wazuh-automation/deployability/modules/allocation/main.py --action delete --track-output ${{ env.ALLOCATOR_PATH }}/track.yml
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file.

### Fixed

- Fix the ova workflow for stages support and AWS instance deletion. ([#175](https://github.com/wazuh/wazuh-virtual-machines/pull/176))
- Fixed the OVA workflow to add support in stages. ([#173](https://github.com/wazuh/wazuh-virtual-machines/pull/173))

### Deleted
Expand Down
6 changes: 6 additions & 0 deletions ova/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ ASSETS_PATH="${CURRENT_PATH}/assets"
CUSTOM_PATH="${ASSETS_PATH}/custom"
INSTALL_ARGS="-a"

if [[ "${PACKAGES_REPOSITORY}" == "dev" ]]; then
INSTALL_ARGS+=" -d pre-release"
elif [[ "${PACKAGES_REPOSITORY}" == "staging" ]]; then
INSTALL_ARGS+=" -d staging"
fi

if [[ "${DEBUG}" = "yes" ]]; then
INSTALL_ARGS+=" -v"
fi
Expand Down
9 changes: 3 additions & 6 deletions ova/workflow_assets/ova_configurer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def clone_repositories():
subprocess.run(f"git clone {repo['url']} {repo['dest']}", shell=True, check=True)


def build_wazuh_install(repo_path, wia_branch, repository):
def build_wazuh_install(repo_path, wia_branch):
"""
Builds the wazuh-install.sh script and moves it to /tmp
Expand All @@ -41,10 +41,7 @@ def build_wazuh_install(repo_path, wia_branch, repository):
if os.path.exists(repo_path):
os.chdir(repo_path)
subprocess.run(f"git checkout {wia_branch}", shell=True, check=True)
command = "sudo bash builder.sh -i"
if repository in ["dev", "staging"]:
command += " -d"
subprocess.run(command, shell=True, check=True)
subprocess.run("sudo bash builder.sh -i", shell=True, check=True)
if os.path.exists("wazuh-install.sh"):
subprocess.run("sudo mv wazuh-install.sh /tmp/wazuh-install.sh", shell=True, check=True)

Expand Down Expand Up @@ -130,7 +127,7 @@ def main():
set_hostname()
install_git()
clone_repositories()
build_wazuh_install("/home/ec2-user/wazuh-installation-assistant", args.wia_branch, args.repository)
build_wazuh_install("/home/ec2-user/wazuh-installation-assistant", args.wia_branch)
run_provision_script(args.wvm_branch, args.repository, args.debug)
create_network_config()
clean()
Expand Down

0 comments on commit 8e2f084

Please sign in to comment.