-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add checksum input and update the upload files to S3 steps #106
Merged
c-bordon
merged 11 commits into
4.10.0
from
bug/105-wazuh-installation-assistant-workflow-misses-the-checksum-input
Oct 16, 2024
Merged
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
1c4433a
Add checksum step with artifact to test it
Enaraque 6b9698f
Fix file basename
Enaraque 31f0d42
Add upload to s3 steps
Enaraque 2480879
Add bucket as string
Enaraque 2867c50
Fix s3 path
Enaraque fc19b19
Change URI echo ti maintain consistency
Enaraque b0b7347
Change variables name
Enaraque 3a194d8
Merge branch '4.10.0' into bug/105-wazuh-installation-assistant-workf…
Enaraque 5b13891
Update changelog
Enaraque d24d2a5
Fix s3 bucket env variable
Enaraque 632a162
Remove -tool from echo in upload files to S3 step
Enaraque File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,22 +12,35 @@ on: | |
description: "Is stage?" | ||
type: boolean | ||
default: false | ||
checksum: | ||
description: "Add checksum" | ||
type: boolean | ||
default: false | ||
id: | ||
description: "ID used to identify the workflow uniquely." | ||
type: string | ||
required: false | ||
workflow_call: | ||
inputs: | ||
WAZUH_INSTALLATION_ASSISTANT_REFERENCE: | ||
description: "Branch or tag of the wazuh-installation-assistant repository." | ||
type: string | ||
required: true | ||
default: 4.10.0 | ||
is_stage: | ||
description: "Is stage?" | ||
type: boolean | ||
default: false | ||
checksum: | ||
description: "Add checksum" | ||
type: boolean | ||
default: false | ||
id: | ||
type: string | ||
required: false | ||
|
||
env: | ||
S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | ||
S3_BUCKET: "packages-dev.internal.wazuh.com" | ||
S3_REPOSITORY_PATH: "development/wazuh/4.x/secondary/installation-assistant" | ||
BUILDER_PATH: "builder.sh" | ||
WAZUH_INSTALL_NAME: "wazuh-install" | ||
|
@@ -73,14 +86,51 @@ jobs: | |
|
||
- name: Build Installation Assistant packages | ||
run: bash builder.sh -i -c -p | ||
|
||
- name: Save files name | ||
run: | | ||
WAZUH_INSTALL_NAME=$(ls ${{ github.workspace }}/${{ env.WAZUH_INSTALL_NAME }}*.sh | xargs basename) | ||
WAZUH_CERT_TOOL_NAME=$(ls ${{ github.workspace }}/${{ env.WAZUH_CERT_TOOL_NAME }}*.sh | xargs basename) | ||
WAZUH_PASSWORD_TOOL_NAME=$(ls ${{ github.workspace }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }}*.sh | xargs basename) | ||
echo "WAZUH_INSTALL_NAME=$WAZUH_INSTALL_NAME" >> $GITHUB_ENV | ||
echo "WAZUH_CERT_TOOL_NAME=$WAZUH_CERT_TOOL_NAME" >> $GITHUB_ENV | ||
echo "WAZUH_PASSWORD_TOOL_NAME=$WAZUH_PASSWORD_TOOL_NAME" >> $GITHUB_ENV | ||
|
||
- name: Prepare files | ||
run: | | ||
mkdir -p ${{ github.workspace }}/${{ env.WAZUH_VERSION }} | ||
mv ${{ env.WAZUH_INSTALL_NAME }}*.sh ${{ github.workspace }}/${{ env.WAZUH_VERSION }} | ||
mv ${{ env.WAZUH_CERT_TOOL_NAME }}*.sh ${{ github.workspace }}/${{ env.WAZUH_VERSION }} | ||
mv ${{ env.WAZUH_PASSWORD_TOOL_NAME }}*.sh ${{ github.workspace }}/${{ env.WAZUH_VERSION }} | ||
|
||
mv ${{ env.WAZUH_INSTALL_NAME }} ${{ github.workspace }}/${{ env.WAZUH_VERSION }} | ||
mv ${{ env.WAZUH_CERT_TOOL_NAME }} ${{ github.workspace }}/${{ env.WAZUH_VERSION }} | ||
mv ${{ env.WAZUH_PASSWORD_TOOL_NAME }} ${{ github.workspace }}/${{ env.WAZUH_VERSION }} | ||
|
||
- name: Build packages checksum | ||
if: ${{ inputs.checksum == true }} | ||
run: | | ||
sha512sum ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }} > ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }}.sha512 | ||
sha512sum ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }} > ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }}.sha512 | ||
sha512sum ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }} > ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }}.sha512 | ||
|
||
- name: Upload files to S3 | ||
run: | | ||
aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }} s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }} --recursive | ||
aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }} s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ | ||
s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }}" | ||
echo "S3 wazuh-install-tool URI: ${s3uri}" | ||
aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }} s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ | ||
s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }}" | ||
echo "S3 wazuh-certs-tool URI: ${s3uri}" | ||
aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }} s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ | ||
s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }}" | ||
echo "S3 wazuh-passwords-tool URI: ${s3uri}" | ||
|
||
- name: Upload checksum files to S3 | ||
if: ${{ inputs.checksum == true }} | ||
run: | | ||
aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }}.sha512 s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ | ||
s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_INSTALL_NAME }}.sha512" | ||
echo "S3 sha512 wazuh-install-tool checksum URI: ${s3uri}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }}.sha512 s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ | ||
s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_CERT_TOOL_NAME }}.sha512" | ||
echo "S3 sha512 wazuh-certs-tool checksum URI: ${s3uri}" | ||
aws s3 cp ${{ github.workspace }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }}.sha512 s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/ | ||
s3uri="s3://${{ env.S3_BUCKET }}/${{ env.S3_REPOSITORY_PATH }}/${{ env.WAZUH_VERSION }}/${{ env.WAZUH_PASSWORD_TOOL_NAME }}.sha512" | ||
echo "S3 sha512 wazuh-passwords-tool checksum URI: ${s3uri}" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use lowercase for the input names:
WAZUH_INSTALLATION_ASSISTANT_REFERENCE
Lines: 7 and 25, and update the references.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in b0b7347