Skip to content

Commit

Permalink
Merge branch '4.10.0' into bug/78-add-files-upload-echo-in-the-ova-bu…
Browse files Browse the repository at this point in the history
…ild-workflow
  • Loading branch information
CarlosALgit committed Oct 16, 2024
2 parents 2a8ea25 + d9a670a commit 4a70f24
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/builder_OVA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ permissions:

jobs:
build_and_run:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Install Ansible
run: sudo apt-get update && sudo apt install -y python3 jq sshpass && python3 -m pip install --user ansible-core==2.16 && pip install pyyaml && ansible-galaxy collection install community.general
Expand All @@ -102,7 +102,7 @@ jobs:
if [ ${{ inputs.is_stage }} == false ]; then
FILENAME="${FILENAME}-${COMMIT_SHA}"
fi
echo "FILENAME=$FILENAME" >> $GITHUB_ENV
FILENAME_OVA="${FILENAME}.ova"
echo "FILENAME_OVA=$FILENAME_OVA" >> $GITHUB_ENV
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/packages_builder_ami.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ permissions:

jobs:
Build_AMI:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: View parameters
run: echo "${{ toJson(inputs) }}"
Expand All @@ -73,15 +73,15 @@ jobs:
with:
role-to-assume: ${{ secrets.AWS_IAM_OVA_ROLE }}
aws-region: us-east-1

- name: Get Wazuh version
run: |
WAZUH_VERSION=$(cat VERSION)
echo WAZUH_VERSION=$WAZUH_VERSION >> $GITHUB_ENV
- name: Install Ansible
run: sudo apt-get update && sudo apt install -y python3 && python3 -m pip install --user ansible-core==2.16

- name: Ansible version
run: ansible --version

Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
echo "::add-mask::$ansible_ssh_common_args"
echo "::add-mask::$identifier"
cat "${{ env.ALLOCATOR_PATH }}/inventory_mod.yml" >> $GITHUB_ENV;
- name: Generate inventory
run: |
echo "[gha_instance]" > ${{ env.ALLOCATOR_PATH }}/inventory_ansible.ini
Expand All @@ -138,7 +138,7 @@ jobs:
while [ $ELAPSED -lt $TIMEOUT ]; do
STATUS=$(aws ec2 describe-instances --instance-ids ${{ env.identifier }} --query 'Reservations[*].Instances[*].State.Name' --output text)
echo "Instance status: $STATUS"
if [ "$STATUS" == "stopped" ]; then
echo "Instance is stopped."
break
Expand All @@ -162,18 +162,18 @@ jobs:
AMI_ID=$(aws ec2 describe-images --filters "Name=name,Values=$AMI_NAME" --query 'Images[*].ImageId' --output text)
echo "AMI_ID=$AMI_ID" >> $GITHUB_ENV
echo "AMI creation started with name $AMI_NAME"
- name: Check AMI status until available
id: check_ami_status
run: |
TIMEOUT=1800
INTERVAL=30
ELAPSED=0
while [ $ELAPSED -lt $TIMEOUT ]; do
STATUS=$(aws ec2 describe-images --image-ids ${{ env.AMI_ID }} --query 'Images[*].State' --output text)
echo "AMI status: $STATUS"
if [ "$STATUS" == "available" ]; then
echo "AMI is available."
break
Expand All @@ -197,10 +197,10 @@ jobs:
- name: Delete allocated VM
if: always() && steps.alloc_vm_ami.outcome == 'success' && inputs.DESTROY == true
run: python3 wazuh-automation/deployability/modules/allocation/main.py --action delete --track-output ${{ env.ALLOCATOR_PATH }}/track.yml

- name: Compress Allocator directory
id: generate_artifacts
if: always() && steps.alloc_vm_ami.outcome == 'success' && inputs.DESTROY == false
if: always() && steps.alloc_vm_ami.outcome == 'success' && inputs.DESTROY == false
run: zip -P "${{ secrets.ZIP_ARTIFACTS_PASSWORD }}" -r ${{ env.ALLOCATOR_PATH }}.zip ${{ env.ALLOCATOR_PATH }}
continue-on-error: true

Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ All notable changes to this project will be documented in this file.

### Fixed

- Deleted dashboard logs cleanup in OVA local build([#57](https://github.com/wazuh/wazuh-virtual-machines/pull/57))
- Changed GitHub Runner version to fix Python error ([#82](https://github.com/wazuh/wazuh-virtual-machines/pull/82))
- Deleted dashboard logs cleanup in OVA local build ([#57](https://github.com/wazuh/wazuh-virtual-machines/pull/57))
- Fix typos and add news inputs in the AMI workflow header ([#35](https://github.com/wazuh/wazuh-virtual-machines/pull/35))

### Deleted
Expand Down

0 comments on commit 4a70f24

Please sign in to comment.