Skip to content

Commit 01a3a5c

Browse files
authored
Merge pull request #698 from wazuh/change/679-change-the-destination-path-of-the-artifact_urls-file-in-wazuh-virtual-machines
Change the destination path of the artifact_urls file for pre-release and prod environments
2 parents 23c199b + a8d9096 commit 01a3a5c

9 files changed

Lines changed: 33 additions & 32 deletions

File tree

.github/workflows/builder_OVA.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ jobs:
245245
- name: Get artifacts URLs file
246246
run: |
247247
if [ "${{ inputs.wazuh_package_type }}" == "prod" ]; then
248-
curl -f "https://${{ vars.PACKAGES_PROD_URL }}/production/${{ env.WAZUH_MAJOR }}.x/artifact_urls_${{ env.WAZUH_VERSION }}.yaml" -o ${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}
248+
curl -f "https://${{ vars.PACKAGES_PROD_URL }}/production/${{ env.WAZUH_MAJOR }}.x/artifact-urls/artifact_urls_${{ env.WAZUH_VERSION }}.yaml" -o ${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}
249249
elif [ "${{ inputs.wazuh_package_type }}" == "pre-prod" ]; then
250-
curl -f "https://${{ vars.PACKAGES_STAGING_URL }}/pre-release/${{ env.WAZUH_MAJOR }}.x/artifact_urls_${{ env.WAZUH_VERSION }}-${{ env.WAZUH_REVISION }}.yaml" -o ${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}
250+
curl -f "https://${{ vars.PACKAGES_STAGING_URL }}/pre-release/${{ env.WAZUH_MAJOR }}.x/artifact-urls/artifact_urls_${{ env.WAZUH_VERSION }}-${{ env.WAZUH_REVISION }}.yaml" -o ${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}
251251
else
252252
LOCAL_AWS_S3_BUCKET_DEV=${{ vars.AWS_S3_BUCKET_DEV }}
253253
echo LOCAL_AWS_S3_BUCKET_DEV=$LOCAL_AWS_S3_BUCKET_DEV >> $GITHUB_ENV

.github/workflows/packages_builder_ami.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ jobs:
246246
- name: Get artifacts URLs file
247247
run: |
248248
if [ "${{ inputs.wazuh_package_type }}" == "prod" ]; then
249-
curl -f "https://${{ vars.PACKAGES_PROD_URL }}/production/${{ env.WAZUH_MAJOR }}.x/artifact_urls_${{ env.WAZUH_VERSION }}.yaml" -o ${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}
249+
curl -f "https://${{ vars.PACKAGES_PROD_URL }}/production/${{ env.WAZUH_MAJOR }}.x/artifact-urls/artifact_urls_${{ env.WAZUH_VERSION }}.yaml" -o ${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}
250250
elif [ "${{ inputs.wazuh_package_type }}" == "pre-prod" ]; then
251-
curl -f "https://${{ vars.PACKAGES_STAGING_URL }}/pre-release/${{ env.WAZUH_MAJOR }}.x/artifact_urls_${{ env.WAZUH_VERSION }}-${{ env.WAZUH_REVISION }}.yaml" -o ${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}
251+
curl -f "https://${{ vars.PACKAGES_STAGING_URL }}/pre-release/${{ env.WAZUH_MAJOR }}.x/artifact-urls/artifact_urls_${{ env.WAZUH_VERSION }}-${{ env.WAZUH_REVISION }}.yaml" -o ${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}
252252
else
253253
LOCAL_AWS_S3_BUCKET_DEV=${{ vars.AWS_S3_BUCKET_DEV }}
254254
echo LOCAL_AWS_S3_BUCKET_DEV=$LOCAL_AWS_S3_BUCKET_DEV >> $GITHUB_ENV

.github/workflows/test-vm.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,9 +572,9 @@ jobs:
572572
- name: Get artifacts URLs file
573573
run: |
574574
if [ "${{ inputs.wazuh_package_type }}" == "prod" ]; then
575-
curl -f "https://${{ vars.PACKAGES_PROD_URL }}/production/${{ env.WAZUH_MAJOR }}.x/artifact_urls_${{ env.WAZUH_VERSION }}.yaml" -o ${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}
575+
curl -f "https://${{ vars.PACKAGES_PROD_URL }}/production/${{ env.WAZUH_MAJOR }}.x/artifact-urls/artifact_urls_${{ env.WAZUH_VERSION }}.yaml" -o ${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}
576576
elif [ "${{ inputs.wazuh_package_type }}" == "pre-prod" ]; then
577-
curl -f "https://${{ vars.PACKAGES_STAGING_URL }}/pre-release/${{ env.WAZUH_MAJOR }}.x/artifact_urls_${{ env.WAZUH_VERSION }}-${{ env.WAZUH_REVISION }}.yaml" -o ${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}
577+
curl -f "https://${{ vars.PACKAGES_STAGING_URL }}/pre-release/${{ env.WAZUH_MAJOR }}.x/artifact-urls/artifact_urls_${{ env.WAZUH_VERSION }}-${{ env.WAZUH_REVISION }}.yaml" -o ${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}
578578
else
579579
LOCAL_AWS_S3_BUCKET_DEV=${{ vars.AWS_S3_BUCKET_DEV }}
580580
echo LOCAL_AWS_S3_BUCKET_DEV=$LOCAL_AWS_S3_BUCKET_DEV >> $GITHUB_ENV

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ All notable changes to this project will be documented in this file.
2222

2323
### Changed
2424

25+
- Change the destination path of the artifact_urls file for pre-release and prod environments ([#698](https://github.com/wazuh/wazuh-virtual-machines/pull/698))
2526
- Changed OVA and AMI deployment requirements and documentation ([#694](https://github.com/wazuh/wazuh-virtual-machines/pull/694))
2627
- Reverted PR 641. ([#649](https://github.com/wazuh/wazuh-virtual-machines/pull/649))
2728
- Fix manager certificates ownership ([#648](https://github.com/wazuh/wazuh-virtual-machines/pull/648))

provisioner/utils/enums.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
class AllowedUrlHost(StrEnum):
55
RELEASE = "packages.wazuh.com"
6-
PRE_RELEASE = "packages-dev.wazuh.com"
6+
PRE_RELEASE = "packages-staging.xdrsiem.wazuh.info"
77
INTERNAL = "xdrsiem-packages-dev-internal"
88

99

tests/test_provisioner/test_models/test_input.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,13 @@ def test_inventory_content_no_host_name(mock_open):
140140

141141
@patch("provisioner.models.input.format_passwords_tool_urls_file")
142142
def test_passwords_tool_url_success(mock_format_passwords_tool_urls_file):
143-
mock_format_passwords_tool_urls_file.return_value = "https://packages-dev.wazuh.com/password-tool"
143+
mock_format_passwords_tool_urls_file.return_value = "https://packages-staging.xdrsiem.wazuh.info/password-tool"
144144

145145
passwords_tool_content = INPUT_EXAMPLE.passwords_tool_content
146146

147147
mock_format_passwords_tool_urls_file.assert_called_once_with(Path("/path/to/packages_url"))
148148
assert isinstance(passwords_tool_content, PasswordsToolInfo)
149-
assert passwords_tool_content.url == AnyUrl("https://packages-dev.wazuh.com/password-tool")
149+
assert passwords_tool_content.url == AnyUrl("https://packages-staging.xdrsiem.wazuh.info/password-tool")
150150

151151

152152
@patch("provisioner.models.input.format_passwords_tool_urls_file")

tests/test_provisioner/test_models/test_utils/test_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
"url",
1010
[
1111
"https://packages.wazuh.com/4.x/yum/",
12-
"https://packages-dev.wazuh.com/doing/tests"
12+
"https://packages-staging.xdrsiem.wazuh.info/doing/tests"
1313
"htts://xdrsiem-packages-dev-internal"
1414
"https://packages.wazuh.com"
15-
"https://packages-dev.wazuh.com",
15+
"https://packages-staging.xdrsiem.wazuh.info",
1616
"https://xdrsiem-packages-dev-internal",
1717
],
1818
)

tests/test_provisioner/test_provisioner.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ def component_info_valid(valid_inventory):
2424
dependencies = ["dependency1", "dependency2"]
2525
component_manager = ComponentInfo(
2626
name=Component.WAZUH_MANAGER,
27-
package_url=AnyUrl("http://packages-dev.wazuh.com"),
27+
package_url=AnyUrl("http://packages-staging.xdrsiem.wazuh.info"),
2828
dependencies=dependencies,
2929
)
3030
certs = CertsInfo(
3131
certs_url_content={
32-
"certs_tool": "http://packages-dev.wazuh.com/example/certs-tool.sh",
33-
"config": "http://packages-dev.wazuh.com/example/config.yml",
32+
"certs_tool": "http://packages-staging.xdrsiem.wazuh.info/example/certs-tool.sh",
33+
"config": "http://packages-staging.xdrsiem.wazuh.info/example/config.yml",
3434
}
3535
)
36-
passwords_tool = PasswordsToolInfo(url=AnyUrl("http://packages-dev.wazuh.com/example/passwords-tool.sh"))
36+
passwords_tool = PasswordsToolInfo(url=AnyUrl("http://packages-staging.xdrsiem.wazuh.info/example/passwords-tool.sh"))
3737

3838
package_type = Package_type.RPM
3939
return Provisioner(
@@ -61,9 +61,9 @@ def test_provision_success(mock_paramiko, mock_logger, component_info_valid, moc
6161
mock_paramiko.return_value = mock_client_instance
6262

6363
tools_expect_commands = [
64-
"mkdir -p ~/wazuh-configure/tools/certs && curl -s -o ~/wazuh-configure/tools/certs/certs-tool.sh 'http://packages-dev.wazuh.com/example/certs-tool.sh'",
65-
"mkdir -p ~/wazuh-configure/tools/certs && curl -s -o ~/wazuh-configure/tools/certs/config.yml 'http://packages-dev.wazuh.com/example/config.yml'",
66-
"mkdir -p ~/wazuh-configure/tools && curl -s -o ~/wazuh-configure/tools/passwords-tool.sh 'http://packages-dev.wazuh.com/example/passwords-tool.sh'",
64+
"mkdir -p ~/wazuh-configure/tools/certs && curl -s -o ~/wazuh-configure/tools/certs/certs-tool.sh 'http://packages-staging.xdrsiem.wazuh.info/example/certs-tool.sh'",
65+
"mkdir -p ~/wazuh-configure/tools/certs && curl -s -o ~/wazuh-configure/tools/certs/config.yml 'http://packages-staging.xdrsiem.wazuh.info/example/config.yml'",
66+
"mkdir -p ~/wazuh-configure/tools && curl -s -o ~/wazuh-configure/tools/passwords-tool.sh 'http://packages-staging.xdrsiem.wazuh.info/example/passwords-tool.sh'",
6767
]
6868

6969
dependencies_expect_commands = [
@@ -74,7 +74,7 @@ def test_provision_success(mock_paramiko, mock_logger, component_info_valid, moc
7474
]
7575

7676
package_expect_commands = [
77-
"mkdir -p ~/wazuh-configure/packages && curl -s -o ~/wazuh-configure/packages/wazuh_manager.rpm 'http://packages-dev.wazuh.com/'",
77+
"mkdir -p ~/wazuh-configure/packages && curl -s -o ~/wazuh-configure/packages/wazuh_manager.rpm 'http://packages-staging.xdrsiem.wazuh.info/'",
7878
"sudo dnf install -y ~/wazuh-configure/packages/wazuh_manager.rpm",
7979
]
8080

@@ -127,7 +127,7 @@ def test_certs_tool_provision_success(
127127
getattr(component_info_valid, certs_method)(mock_client_instance)
128128

129129
mock_exec_command.assert_called_once_with(
130-
command=f"mkdir -p ~/wazuh-configure/tools/certs && curl -s -o ~/wazuh-configure/tools/certs/{certs_component} 'http://packages-dev.wazuh.com/example/{certs_component}'",
130+
command=f"mkdir -p ~/wazuh-configure/tools/certs && curl -s -o ~/wazuh-configure/tools/certs/{certs_component} 'http://packages-staging.xdrsiem.wazuh.info/example/{certs_component}'",
131131
client=mock_client_instance,
132132
)
133133
mock_logger.debug.assert_any_call(f"Provisioning {certs_component}")
@@ -149,7 +149,7 @@ def test_certs_tool_provision_failure(
149149
getattr(component_info_valid, certs_method)(mock_client_instance)
150150

151151
mock_exec_command.assert_called_once_with(
152-
command=f"mkdir -p ~/wazuh-configure/tools/certs && curl -s -o ~/wazuh-configure/tools/certs/{certs_component} 'http://packages-dev.wazuh.com/example/{certs_component}'",
152+
command=f"mkdir -p ~/wazuh-configure/tools/certs && curl -s -o ~/wazuh-configure/tools/certs/{certs_component} 'http://packages-staging.xdrsiem.wazuh.info/example/{certs_component}'",
153153
client=mock_client_instance,
154154
)
155155
mock_logger.debug.assert_any_call(f"Provisioning {certs_component}")
@@ -230,7 +230,7 @@ def test_packages_provision_success(
230230
mock_exec_command.assert_has_calls(
231231
[
232232
mock.call(
233-
command=f"mkdir -p ~/wazuh-configure/packages && curl -s -o {expected_path} 'http://packages-dev.wazuh.com/'",
233+
command=f"mkdir -p ~/wazuh-configure/packages && curl -s -o {expected_path} 'http://packages-staging.xdrsiem.wazuh.info/'",
234234
client=mock_client_instance,
235235
),
236236
mock.call(
@@ -250,19 +250,19 @@ def test_packages_provision_success(
250250
(
251251
Package_manager.YUM,
252252
Component.WAZUH_MANAGER,
253-
"http://packages-dev.wazuh.com/wazuh_manager.rpm",
253+
"http://packages-staging.xdrsiem.wazuh.info/wazuh_manager.rpm",
254254
"wazuh_manager.rpm",
255255
),
256256
(
257257
Package_manager.YUM,
258258
Component.WAZUH_AGENT,
259-
"http://packages-dev.wazuh.com/wazuh_agent.rpm",
259+
"http://packages-staging.xdrsiem.wazuh.info/wazuh_agent.rpm",
260260
"wazuh_agent.rpm",
261261
),
262262
(
263263
Package_manager.APT,
264264
Component.WAZUH_INDEXER,
265-
"http://packages-dev.wazuh.com/wazuh_indexer.deb",
265+
"http://packages-staging.xdrsiem.wazuh.info/wazuh_indexer.deb",
266266
"wazuh_indexer.deb",
267267
),
268268
],
@@ -295,9 +295,9 @@ def test_get_package_by_url_success(
295295
@pytest.mark.parametrize(
296296
"component_name, package_url, error_output",
297297
[
298-
(Component.WAZUH_MANAGER, "http://packages-dev.wazuh.com/wazuh_manager.rpm", "Error output"),
299-
(Component.WAZUH_AGENT, "http://packages-dev.wazuh.com/wazuh_agent.rpm", "Error output"),
300-
(Component.WAZUH_INDEXER, "http://packages-dev.wazuh.com/wazuh_indexer.deb", "Error output"),
298+
(Component.WAZUH_MANAGER, "http://packages-staging.xdrsiem.wazuh.info/wazuh_manager.rpm", "Error output"),
299+
(Component.WAZUH_AGENT, "http://packages-staging.xdrsiem.wazuh.info/wazuh_agent.rpm", "Error output"),
300+
(Component.WAZUH_INDEXER, "http://packages-staging.xdrsiem.wazuh.info/wazuh_indexer.deb", "Error output"),
301301
],
302302
)
303303
@patch("paramiko.SSHClient")

wazuh_local_ova/enums.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ class EnvironmentType(StrEnum):
88

99

1010
class ArtifactFilePath(StrEnum):
11-
RELEASE = "https://packages.wazuh.com/production/{major}.x/artifact_urls_{wazuh-version}.yaml"
12-
PRE_RELEASE = "https://packages-staging.xdrsiem.wazuh.info/pre-release/{major}.x/artifact_urls_{wazuh-version}-{wazuh-revision}.yaml"
11+
RELEASE = "https://packages.wazuh.com/production/{major}.x/artifact-urls/artifact_urls_{wazuh-version}.yaml"
12+
PRE_RELEASE = "https://packages-staging.xdrsiem.wazuh.info/pre-release/{major}.x/artifact-urls/artifact_urls_{wazuh-version}-{wazuh-revision}.yaml"
1313
DEV = "./artifact_urls.yaml"
1414

1515
def build(self, version: str = "", revision: str = "") -> str:
@@ -30,10 +30,10 @@ def build(self, version: str = "", revision: str = "") -> str:
3030
3131
Examples:
3232
>>> ArtifactFilePath.RELEASE.build(version="5.0.0")
33-
'https://packages.wazuh.com/production/5.x/artifact_urls_5.0.0.yaml'
33+
'https://packages.wazuh.com/production/5.x/artifact-urls/artifact_urls_5.0.0.yaml'
3434
3535
>>> ArtifactFilePath.PRE_RELEASE.build(version="5.0.0", revision="1")
36-
'https://packages-staging.xdrsiem.wazuh.info/pre-release/5.x/artifact_urls_5.0.0-1.yaml'
36+
'https://packages-staging.xdrsiem.wazuh.info/pre-release/5.x/artifact-urls/artifact_urls_5.0.0-1.yaml'
3737
3838
>>> ArtifactFilePath.DEV.build()
3939
'./artifact_urls.yaml'

0 commit comments

Comments
 (0)