-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Support CI for Windows and MacOS (#1164) Creates a github action to install and configure Dashboards that is reused within the workflows of this repository, its multi-platform safe. Signed-off-by: Peter Nied <[email protected]> (cherry picked from commit a21c7be) * Support checkout out #.X branch types Signed-off-by: Peter Nied <[email protected]>
- Loading branch information
Showing
3 changed files
with
114 additions
and
124 deletions.
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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: 'Install Dashboards with Plugin' | ||
description: 'Installs OpenSearch Dashboard with a Plugin from github, then checkouts the correct dashboards version for the plugin, configures npm/yarn, and bootstraps Dashboards' | ||
|
||
inputs: | ||
plugin_name: | ||
description: 'The the name of the plugin to use, such as security-dashboards-plugin' | ||
required: true | ||
|
||
outputs: | ||
dashboards-directory: | ||
description: "The directory where the dashboards has been configured" | ||
value: ${{ steps.determine-dashboards-directory.outputs.dashboards-directory }} | ||
|
||
plugin-directory: | ||
description: "The directory where the plugin has been configured" | ||
value: ${{ steps.determine-plugin-directory.outputs.plugin-directory }} | ||
|
||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- id: determine-dashboards-directory | ||
run: echo "dashboards-directory=OpenSearch-Dashboards" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- id: determine-plugin-directory | ||
run: echo "::set-output name=plugin-directory::./OpenSearch-Dashboards/plugins/${{ inputs.plugin_name }}" | ||
# run: echo "plugin-directory=./OpenSearch-Dashboards/plugins/${{ inputs.plugin_name }}" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
path: OpenSearch-Dashboards | ||
repository: opensearch-project/OpenSearch-Dashboards | ||
ref: 'main' | ||
fetch-depth: 0 | ||
|
||
- run: mkdir -p plugins | ||
working-directory: OpenSearch-Dashboards | ||
shell: bash | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
path: ${{ steps.determine-plugin-directory.outputs.plugin-directory }} | ||
# ref: ${{ github.ref }} | ||
|
||
- id: osd-version | ||
continue-on-error: true | ||
run: | | ||
echo "::set-output name=osd-version::$(cat package.json | jq '.opensearchDashboards.version' | cut -c 2-4)" | ||
echo "::set-output name=osd-x-version::$(cat package.json | jq '.opensearchDashboards.version' | cut -c 2-3)" | ||
working-directory: ${{ steps.determine-plugin-directory.outputs.plugin-directory }} | ||
shell: bash | ||
|
||
- id: branch-switch-if-possible | ||
continue-on-error: true # Defaults onto main if the branch switch doesn't work | ||
if: ${{ steps.osd-version.outputs.osd-version }} | ||
run: git checkout ${{ steps.osd-version.outputs.osd-version }} || git checkout ${{ steps.osd-version.outputs.osd-x-version }}x | ||
working-directory: ./OpenSearch-Dashboards | ||
shell: bash | ||
|
||
- id: tool-versions | ||
run: | | ||
echo "node_version=$(cat .node-version)" >> $GITHUB_OUTPUT | ||
echo "yarn_version=$(jq -r '.engines.yarn' package.json)" >> $GITHUB_OUTPUT | ||
working-directory: OpenSearch-Dashboards | ||
shell: bash | ||
|
||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ steps.tool-versions.outputs.node_version }} | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- run: | | ||
npm uninstall -g yarn | ||
echo "Installing yarn ${{ steps.tool-versions.outputs.yarn_version }}" | ||
npm i -g yarn@${{ steps.tool-versions.outputs.yarn_version }} | ||
working-directory: OpenSearch-Dashboards | ||
shell: bash | ||
- run: yarn osd bootstrap --oss | ||
working-directory: OpenSearch-Dashboards | ||
shell: bash |
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
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