Skip to content

Commit

Permalink
added venv usage to ami workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosALgit committed Oct 15, 2024
1 parent 65cd8ad commit f8070ca
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/packages_builder_ami.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,16 @@ jobs:
WAZUH_VERSION=$(cat VERSION)
echo WAZUH_VERSION=$WAZUH_VERSION >> $GITHUB_ENV
- name: Install Python and create virtual environment
run: |
sudo apt-get update
sudo apt install -y python3 && sudo apt-get install python3-venv
python3 -m venv ami_env
- name: Install Ansible
run: sudo apt-get update && sudo apt install -y python3 && python3 -m pip install --user ansible-core==2.16 --break-system-packages
run: |
source ami_env/bin/activate
python3 -m pip install --user ansible-core==2.16
- name: Ansible version
run: ansible --version
Expand All @@ -95,11 +103,13 @@ jobs:

- name: Install and set allocator requirements
run: |
pip3 install -r wazuh-automation/deployability/deps/requirements.txt --break-system-packages
source ami_env/bin/activate
python3 -m pip install -r wazuh-automation/deployability/deps/requirements.txt
- name: Execute allocator module that will create the base instance
id: alloc_vm_ami
run: |
source ami_env/bin/activate
python3 wazuh-automation/deployability/modules/allocation/main.py --action create --provider aws --size large --composite-name ${{ env.COMPOSITE_NAME }} --working-dir ${{ env.ALLOCATOR_PATH }} \
--track-output ${{ env.ALLOCATOR_PATH }}/track.yml --inventory-output ${{ env.ALLOCATOR_PATH }}/inventory.yml --instance-name gha_${{ github.run_id }}_ami_build \
--label-team devops --label-termination-date 1d
Expand Down

0 comments on commit f8070ca

Please sign in to comment.