Skip to content

Commit

Permalink
Add support for / in branch name (#7183)
Browse files Browse the repository at this point in the history
* Apply reference name change

* Add new github reference to docker image builder

---------

Co-authored-by: Antonio <[email protected]>
  • Loading branch information
Tostti and Desvelao authored Dec 4, 2024
1 parent b318cac commit 4d9375d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/dev-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,17 @@ jobs:
cd /home/node/kbn/plugins/${{ matrix.plugins.container_path }} && yarn && ${{ inputs.command }};
'
- name: Get the plugin version
- name: Get the plugin version and and format reference name
run: |
echo "githubReference=$(echo ${{ inputs.reference }} | sed 's/\//-/g')" >> $GITHUB_ENV
echo "version=$(jq -r '.version' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV
echo "revision=$(jq -r '.revision' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV
- name: Step 04 - Upload artifact to GitHub
if: ${{ inputs.artifact_name && inputs.artifact_path }}
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.artifact_name }}_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip
name: ${{ inputs.artifact_name }}_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip
path: ${{ matrix.plugins.path }}/${{ inputs.artifact_path }}
if-no-files-found: 'error'

Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/manual-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ jobs:
ref: ${{ inputs.reference }}
path: wazuh

- name: Step 02 - Get version and revision
- name: Step 02 - Set variables
run: |
echo "githubReference=$(echo ${{ inputs.reference }} | sed 's/\//-/g')" >> $GITHUB_ENV
echo "currentDir=$(pwd -P)" >> $GITHUB_ENV
echo "version=$(jq -r '.version' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV
echo "revision=$(jq -r '.revision' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV
Expand All @@ -55,11 +56,11 @@ jobs:
- name: Step 03 - Download the plugin's source code
uses: actions/download-artifact@v3
with:
name: wazuh-dashboard-plugins_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip
path: ${{ env.currentDir }}/wazuh/scripts/test-packages/wazuh-dashboard-plugins_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip
name: wazuh-dashboard-plugins_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip
path: ${{ env.currentDir }}/wazuh/scripts/test-packages/wazuh-dashboard-plugins_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip

- name: Step 04 - Build the Docker image
run: |
echo "current=${{ env.currentDir }}"
cd ./wazuh/scripts/test-packages
docker build --build-arg OSD_VERSION=${{ env.versionPlatform }} --build-arg PACKAGE_NAME=wazuh-dashboard-plugins_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip -f osd-test-packages.Dockerfile ./
docker build --build-arg OSD_VERSION=${{ env.versionPlatform }} --build-arg PACKAGE_NAME=wazuh-dashboard-plugins_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip -f osd-test-packages.Dockerfile ./

0 comments on commit 4d9375d

Please sign in to comment.