Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 38 additions & 8 deletions src/templates/deployWorkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Validate Secrets
run: |
if
[ -z "${{ secrets.CLIENTID }}" ] ||
[ -z "${{ secrets.CLIENTSECRET }}" ] ||
[ -z "${{ secrets.TECHNICALACCID }}" ] ||
[ -z "${{ secrets.TECHNICALACCEMAIL }}" ] ||
[ -z "${{ secrets.IMSORGID }}" ] ||
[ -z "${{ secrets.ORGID }}" ] ||
[ -z "${{ secrets.PROJECTID }}" ] ||
[ -z "${{ secrets.WORKSPACEID }}" ]; then
echo "Please set all required secrets: CLIENTID, CLIENTSECRET, TECHNICALACCID, TECHNICALACCEMAIL, IMSORGID, ORGID, PROJECTID, WORKSPACEID"
exit 1
fi
- name: Setup CLI
uses: adobe/aio-cli-setup-action@1.3.0
with:
Expand All @@ -51,13 +65,29 @@ jobs:
run: aio console:project:select ${{ secrets.PROJECTID }}
- name: Select workspace
run: aio console:workspace:select ${{ secrets.WORKSPACEID }}
- name: "Create env file"
- name: Print AIO CLI Config
run: aio config list
- name: Get Mesh
id: get_mesh
continue-on-error: true
run: |
touch .env
echo API_ENDPOINT="https://xxx.execute-api.us-west-2.amazonaws.com" >> .env
echo API_KEY=${{ secrets.API_KEY }} >> .env
cat .env
- name: Describe
run: aio api-mesh:describe
- name: Update
output=$(aio api-mesh:get 2>&1)
# Escape the output and replace newlines with %0A
escaped_output=$(echo "$output" | tr -d '\r' | tr '\n' ' ')
echo "mesh_output=$escaped_output" >> $GITHUB_OUTPUT
echo "$output"
- name: Debug Get Mesh Output
continue-on-error: true
run: echo "Get Mesh Output - ${{ steps.get_mesh.outputs.mesh_output }}"
- name: Create Mesh
if: ${{ contains(steps.get_mesh.outputs.mesh_output, 'No mesh found') }}
run: aio api-mesh:create -c mesh.json --env .env
- name: Update Mesh
if: ${{ !contains(steps.get_mesh.outputs.mesh_output, 'No mesh found') }}
run: aio api-mesh:update -c mesh.json --env .env
- name: Wait for 30 seconds
run: sleep 30
- name: Describe Mesh
run: aio api-mesh:describe
- name: Get Mesh Status
run: aio api-mesh:status
4 changes: 2 additions & 2 deletions src/templates/loadTestWorkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
- uses: actions/checkout@v3
with:
sparse-checkout: |
script.js
convert.js
k6Tests.js
convertHTMLToPDF.js
reports/
- name: Verify vars are set and fail if not
run: |
Expand Down
23 changes: 23 additions & 0 deletions src/templates/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ Use this repo to bootstrap Adobe API Mesh development with ease. Use this repo t

This repo comes with all the files and dependencies necessary to get started with API Mesh.

1. `mesh.json` - sample mesh config with a single source
2. `.env` - environment file with variables for the config presented in mesh.json
3. `package.json` - dependencies and scripts to test and deploy meshes
4. `.vscode/launch.json` - VS Code configuration to setup debugging out of the box. This applies to VS Code on local machines or Codespaces on Github.com
5. `.devcontainer/devcontainer.json` - Codespaces configuration to setup dev container out of the box. This config will help setup the packages and build the mesh config automatically. As a bonus it also sets up port-forwarding so you can use your favourite GraphQL interface to practice the mesh
6. `.github/workflows/deployMesh.yml` - Github workflow to automatically publish mesh config when something is committed to `main`

# Local Dev

`yarn start mesh.json` - to start the local dev server in watch mode
Expand All @@ -18,6 +25,22 @@ This repo comes with all the files and dependencies necessary to get started wit

`yarn test:perf` - to start the Performance Testing process locally for development. Make sure to update the `MESH_ENDPOINT` in the `test:perf` command located in the `package.json`

# Setup Github Workflows

This repo comes with CICD out of the box but it will need Github Secrets to deploy meshes.

Please add the following secrets to the repo upon setup. Follow the [CICD guide](https://developer.adobe.com/graphql-mesh-gateway/gateway/cicd/) to learn more about acquiring the required secrets.

1. API_KEY
2. CLIENTID
3. CLIENTSECRET
4. IMSORGID
5. ORGID
6. PROJECTID
7. TECHNICALACCEMAIL
8. TECHNICALACCID
9. WORKSPACEID

# Documentation

Check out the [documentation](https://developer.adobe.com/graphql-mesh-gateway/mesh/basic/create-mesh/) for further details on how to create and maintain meshes.
Loading