Skip to content

Commit

Permalink
Merge branch 'master' into ctcarrier/blog/moredesigns
Browse files Browse the repository at this point in the history
  • Loading branch information
sudhanshutech authored Aug 8, 2024
2 parents 637f217 + c1c44b5 commit 3b870a5
Show file tree
Hide file tree
Showing 776 changed files with 69,586 additions and 98,354 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ assignees: ''
### Screenshots
<!--- Add screenshots, if applicable, to help explain your problem.-->

### Enviroment:
### Environment:
- OS: Mac Linux Windows
- Browser: Chrome Safari Firefox
- Version:
Expand Down
157 changes: 35 additions & 122 deletions .github/workflows/add-catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ jobs:
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Set env
run : |
run: |
echo "MESHERY_CLOUD_BASE_URL=https://meshery.layer5.io" >> $GITHUB_ENV
echo "MESHERY_CATALOG_FILES_DIR=catalog" >> $GITHUB_ENV
- name: Cleanup
Expand All @@ -26,122 +30,12 @@ jobs:
for dir in */; do find $dir -maxdepth 1 -type f -delete; done
cd ../../
- id: update_catalog_patterns
name: Update Catalog Patterns
shell: bash
if: ${{ success() }}
name: Update Catalog Patterns in Go
run: |
catalogPatterns=$(curl -sS "$MESHERY_CLOUD_BASE_URL/api/catalog/content/pattern" 2>./err.txt)
if [[ "$(<err.txt)" != "" ]]; then
>&2 echo "Error connecting to Meshery Cloud"
>&2 echo "$(<err.txt)"
fi
echo "$catalogPatterns" | jq -r '.patterns' > temp.json
patternCount=$(echo "$catalogPatterns" | jq '.total_count')
echo "Found $patternCount catalog patterns"
for (( idx=0; idx<$patternCount; idx++ ))
do
designId=$(jq -r .[$idx].id temp.json)
patternInfo="$(jq -r .[$idx].catalog_data.pattern_info temp.json)"
patternCaveats="$(jq -r .[$idx].catalog_data.pattern_caveats temp.json)"
patternType="$(jq -r .[$idx].catalog_data.type temp.json)"
patternName="$(jq -r .[$idx].name temp.json)"
patternFile="$(jq -r .[$idx].pattern_file temp.json)"
patternImageURL="$(jq -r .[$idx].catalog_data.imageURL temp.json)"
if [[ "$patternImageURL" == "null" || "$patternImageURL" == "" ]]; then
# set default snapshot url
patternImageURL="https://raw.githubusercontent.com/layer5labs/meshery-extensions-packages/master/action-assets/design-assets/$designId-light.png,https://raw.githubusercontent.com/layer5labs/meshery-extensions-packages/master/action-assets/design-assets/$designId-dark.png"
else
url_type=$(jq -r ".[$idx].catalog_data.imageURL | type" temp.json)
if [[ $url_type == "array" ]]; then
patternImageURL="$(jq -r ".[$idx].catalog_data.imageURL | join(\",\")" temp.json)"
fi
fi
echo "$patternImageURL"
echo "version: 1.0.0"
compatibility=""
echo "contentID=$designId" >> $GITHUB_OUTPUT
# sets default
if [[ $patternType == "null" ]]; then
patternType="Deployment"
fi
# updates patternType by converting upper to lower case and switching spaces with hyphen
updatedPatternType=$(echo $patternType | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
# check if directory doesn't exists; then create it
if [ ! -d "./collections/_catalog/"$updatedPatternType"" ]; then
echo "$updatedPatternType doesn't exist."
echo "Creating directory... $updatedPatternType"
mkdir "./collections/_catalog/"$updatedPatternType""
fi
if [[ $patternInfo == "null" ]]; then
patternInfo="\"\""
fi
if [[ $patternCaveats == "null" ]]; then
patternCaveats="\"\""
fi
compatLength=$(jq -r ".[$idx].catalog_data.compatibility | length" temp.json)
for (( compatIdx=0; compatIdx<$compatLength; compatIdx++ ))
do
compatibility+="
"
compatibility+=" - $(jq -r ".[$idx].catalog_data.compatibility[$compatIdx]" temp.json)"
done
echo "$patternFile" > $MESHERY_CATALOG_FILES_DIR/$designId.yaml
services=$(yq '.services' $MESHERY_CATALOG_FILES_DIR/$designId.yaml 2>/dev/null)
if [[ $services == "null" || $services == "" ]]; then
patternImageURL="/assets/images/logos/service-mesh-pattern.svg"
fi
userId=$(jq -r .[$idx].user_id temp.json)
userInfo=$(curl -sS "$MESHERY_CLOUD_BASE_URL/api/identity/users/profile/$userId" 2>./err1.txt)
if [[ "$(<err1.txt)" != "" ]]; then
>&2 echo "Error fetching User details"
>&2 echo "$(<err1.txt)"
fi
echo "$userInfo" > info.json
userFullName="$(jq -r .first_name info.json) $(jq -r .last_name info.json)"
userAvatarURL="$(jq -r .avatar_url info.json)"
echo "---
layout: item
name: $patternName
userId: $userId
userName: $userFullName
userAvatarURL: $userAvatarURL
type: $patternType
compatibility: $compatibility
patternId: $designId
image: $patternImageURL
patternInfo: |
$patternInfo
patternCaveats: |
$patternCaveats
URL: 'https://raw.githubusercontent.com/meshery/meshery.io/master/$MESHERY_CATALOG_FILES_DIR/$designId.yaml'
downloadLink: $designId.yaml
---" > ./collections/_catalog/"$(echo $patternType | tr '[:upper:]' '[:lower:]')"/$designId.md
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_ACCESS_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/meshery/meshery.io/actions/workflows/meshmap.yml/dispatches" \
-d '{"ref":"master","inputs":{"contentID":"'$designId'","assetLocation":"'$patternImageURL'"}}'
done
rm temp.json
rm err.txt
rm info.json
rm err1.txt
cd assets/artifact-hub-pkg
go run package.go
env:
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
- name: Update Catalog Filters
if: ${{ success() }}
run: |
Expand Down Expand Up @@ -171,7 +65,7 @@ jobs:
# check if directory doesn't exists; then create it
if [ ! -d "./collections/_catalog/"$(echo $filterType | tr '[:upper:]' '[:lower:]')"" ]; then
echo "$(echo $filterType | tr '[:upper:]' '[:lower:]') doesn't exist."
echo "Creating directory...$(echo $filterType | tr '[:upper:]' '[:lower:]')"
echo "Creating directory...$(echo $filterType | tr '[:upper:]' '[:lower:]')"
mkdir "./collections/_catalog/"$(echo $filterType | tr '[:upper:]' '[:lower:]')""
fi
Expand Down Expand Up @@ -200,11 +94,11 @@ jobs:
echo "$filterFile" > $MESHERY_CATALOG_FILES_DIR/$filterId.yaml
userId=$(jq -r .[$idx].user_id temp.json)
userInfo=$(curl -sS "$MESHERY_CLOUD_BASE_URL/api/identity/users/profile/$userId" 2>./err1.txt)
userInfo=$(curl -sS "$MESHERY_CLOUD_BASE_URL/api/identity/users/profile/$userId" 2>>./err.txt)
if [[ "$(<err1.txt)" != "" ]]; then
>&2 echo "Error fetching User details"
>&2 echo "$(<err1.txt)"
if [[ "$(<err.txt)" != "" ]]; then
>&2 echo "Error fetching User details"
>&2 echo "$(<err.txt)"
fi
echo "$userInfo" > info.json
Expand All @@ -231,7 +125,10 @@ jobs:
---" > ./collections/_catalog/"$(echo $filterType | tr '[:upper:]' '[:lower:]')"/$filterId.md
done
rm temp.json
rm err.txt
- name: Pull changes from remote
run: git pull origin master

- name: Commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
Expand All @@ -241,3 +138,19 @@ jobs:
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
commit_options: '--signoff'
commit_message: '[Catalog] Update Catalog items'
- name: Send Email on Workflow Failure
if: ${{ failure() }}
uses: dawidd6/[email protected]
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
subject: GitHub Actions - Workflow Failure
from: |
"Catalog Update Workflow" <[email protected]>
to: [email protected]
body: |
Meshery's Add Cloud Native Catalog Items <a href="https://github.com/meshery/meshery.io/actions/workflows/add-catalog.yml">workflow</a> encountered error(s). Refer to the attached error log for details or review the [results of the failed workflow](https://github.com/meshery/meshery.io/actions/runs/${{ github.run_id }}).
attachments: err.txt
4 changes: 4 additions & 0 deletions .github/workflows/delete-catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ jobs:
else
echo "No Filters to delete"
fi
- name: Pull changes from remote
run: git pull origin master

- name: Commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/updateDiscussons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:
token: ${{ secrets.GH_ACCESS_TOKEN }}
- name: Fetch data for meshery tag
run: curl https://discuss.layer5.io/tag/meshery.json -o _data/discuss/meshery.json

- name: Pull changes from remote
run: git pull origin master

- name: Commit results
uses: stefanzweifel/git-auto-commit-action@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion _data/discuss/meshery.json

Large diffs are not rendered by default.

35 changes: 18 additions & 17 deletions _data/features.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
- type: 1
title: Access the <span class="special-text">Cloud Native Patterns</span> for Kubernetes
description: Design and manage all of your cloud native infrastructure using the design configurator in Meshery or start from a template using the patterns from the catalog.
logoLightMode: /assets/images/patterns/service-mesh-patterns-side.svg
logoDarkMode: /assets/images/patterns/service-mesh-patterns-side-white.png
logoDescription: Cloud native design patterns
videoPoster: /assets/images/patterns/smp-video-poster-play.png
title: See changes to your infra <span class="special-text">before you merge</span>
description: Get snapshots of your infrastructure directly in your PRs. Preview your deployment, view changes pull request-to-pull request and get infrastructure snapshots within your PRs by connecting MeshMap to your GitHub repositories. <div class="button-para"><a href="https://docs.meshery.io/extensions/snapshot" class="highlight">View Docs</a></div>
logo: /assets/images/meshmap-icon.svg
image: /assets/images/gitops-snapshot.png
list:
- See your deployment before you merge
- Connect MeshMap to your GitHub repo and see changes pull request-to-pull request
- Get snapshots of your infrastructure directly in your PRs

- type: 2
title: Operate with <span class="special-text">configuration best practices</span>
Expand All @@ -18,11 +20,12 @@
logo: /assets/images/webassembly_logo.svg
image: /assets/images/meshery-wasm.png
imageDescription: Webassembly based Envoy Filters
videoPoster: /assets/images/features/wasm-filter-mgmt-poster.png

- type: 4
title: Retrieves and presents the contents of a designated filter through <span class="special-text">identification by name or ID</span>
description: <div class="button-para"> <a href="https://docs.meshery.io/reference/mesheryctl/filter/view" class="highlight">View Docs</a> </div>
image: /assets/images/filter-view.png
title: Control all of your infrastructure with <span class="special-text">mesheryctl</span>
description: Whether managing multiple Meshery deployments, importing designs, discoverying Kubernetes clusters, do so with ease using Meshery CLI in your terminal. <div class="button-para"><a href="https://docs.meshery.io/reference/mesheryctl/" class="highlight">View Docs</a></div>
image: /assets/images/features/ctl/mesheryctl-system-update.jpeg

- type: 5
title: <span class="special-text">Context-Aware</span> Policies For Applications
Expand All @@ -32,14 +35,12 @@
imageDescription: Context-aware OPA

- type: 6
title: Simplify the process of Infrastructure Managment with <span class="special-text">GitOps Snapshots</span>
description: Streamlining Platform Engineering with GitOps and Meshery. Preview your deployment, view changes pull request-to-pull request and get infrastructure snapshots within your PRs by connecting MeshMap to your GitHub repositories.
logo: /assets/images/meshmap-icon.svg
image: /assets/images/gitops-snapshot.png
list:
- See your deployment before you merge
- Connect MeshMap to your GitHub repo and see changes pull request-to-pull request
- Get snapshots of your infrastructure directly in your PRs
title: Access the <span class="special-text">Cloud Native Patterns</span> for Kubernetes
description: Design and manage all of your cloud native infrastructure using the design configurator in Meshery or start from a template using the patterns from the catalog.
logoLightMode: /assets/images/patterns/service-mesh-patterns-side.svg
logoDarkMode: /assets/images/patterns/service-mesh-patterns-side-white.png
logoDescription: Cloud native design patterns
videoPoster: /assets/images/patterns/smp-video-poster-play.png

- type: 7
title: Manage the <span class="special-text">performance</span> of your infrastructure and its workloads
Expand Down
Loading

0 comments on commit 3b870a5

Please sign in to comment.