Skip to content

Commit

Permalink
Merge branch 'main' into delete-pet
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolb committed Sep 8, 2023
2 parents 045c4b5 + 62f4be9 commit 84e428a
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 6 deletions.
38 changes: 37 additions & 1 deletion .github/workflows/spectral.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Spectral Lint
name: Quality Pipeline
permissions: write-all
on:
pull_request:
Expand Down Expand Up @@ -41,3 +41,39 @@ jobs:
env:
POSTMAN_API_KEY: ${{ secrets.POSTMAN_API_KEY }}
if: github.event_name == 'release'

- name: Setup Deck
run: |
curl -sL https://github.com/kong/deck/releases/download/v1.25.0/deck_1.25.0_linux_amd64.tar.gz -o deck.tar.gz
tar -xf deck.tar.gz -C /tmp
sudo cp /tmp/deck /usr/local/bin/
# Ping to your Kong instance
- name: decK ping
id: decK_ping
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DECK_GROUP_NAME: ${{ secrets.DECK_GROUP_NAME }}
DECK_PAT: ${{ secrets.DECK_PAT }}
run: deck ping --konnect-runtime-group-name ${{ secrets.DECK_GROUP_NAME }} --konnect-token ${{ secrets.DECK_PAT }}
if: github.event_name == 'release'

# Generate Config File to sync
- name: decK file openapi2kong
id: deck_file_openapi2kong
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DECK_GROUP_NAME: ${{ secrets.DECK_GROUP_NAME }}
DECK_PAT: ${{ secrets.DECK_PAT }}
run: deck file openapi2kong --spec ./spec/petStore.json --output-file ./kong/petStoreKong.yaml
if: github.event_name == 'release'

# Sync the state of the files to the Kong instance and update the deployment status in your repo by GitHub Deployment API
- name: decK sync
id: decK_sync
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DECK_GROUP_NAME: ${{ secrets.DECK_GROUP_NAME }}
DECK_PAT: ${{ secrets.DECK_PAT }}
run: deck sync -s ./kong/petStoreKong.yaml --konnect-runtime-group-name ${{ secrets.DECK_GROUP_NAME }} --konnect-token ${{ secrets.DECK_PAT }}
if: github.event_name == 'release'
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# IMPACT23-API-Lifecycle
# API-Quality-Lifecycle

Demo Workshop for 2023 Cisco IMPACT
Demo Workshop for leveraging open source tools to deploy and check APIs for quality gates.

## Overview

Expand All @@ -20,6 +20,7 @@ Demo Workshop for 2023 Cisco IMPACT
- [Postman](https://www.postman.com/)
- [NPM](https://npmjs.com)
- [TypeScript](https://www.typescriptlang.org/)
- [Kong](https://konghq.com/)

## Generating and running

Expand All @@ -32,13 +33,13 @@ Demo Workshop for 2023 Cisco IMPACT
Clone the Repository: First, clone the repository to your local machine:

```bash
git clone https://github.com/dtolb/IMPACT23-API-Lifecycle.git
git clone https://github.com/dtolb/API-Quality-Lifecycle.git
```

Navigate to the Project Directory:

```bash
cd IMPACT23-API-Lifecycle
cd API-Quality-Lifecycle
```

Install Dependencies: Now, install the necessary project dependencies using Yarn:
Expand Down
52 changes: 52 additions & 0 deletions kong/petKong.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
_format_version: '3.0'
services:
- host: localhost
id: 6ce82fd3-ffaa-564d-a98e-7b6cf11d7b5a
name: petstore
path: /v1
plugins: []
port: 3000
protocol: http
routes:
- id: fcabe360-daec-5fbf-a2be-50f393c23e38
methods:
- GET
name: petstore_listpets
paths:
- ~/pets$
plugins: []
regex_priority: 200
strip_path: false
tags: []
- id: b3862911-a318-51f8-99e7-5f6f3685c61f
methods:
- POST
name: petstore_createpet
paths:
- ~/pets$
plugins: []
regex_priority: 200
strip_path: false
tags: []
- id: 0ef5ebf6-6973-5d23-a051-ab9367803be3
methods:
- GET
name: petstore_getpet
paths:
- ~/pets/(?<id>[^#?/]+)$
plugins: []
regex_priority: 100
strip_path: false
tags: []
- id: 7f1a9c95-7df0-5a54-8619-a59ace7f5604
methods:
- PUT
name: petstore_updatepet
paths:
- ~/pets/(?<id>[^#?/]+)$
plugins: []
regex_priority: 100
strip_path: false
tags: []
tags: []
upstreams: []
2 changes: 1 addition & 1 deletion tsoa.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"noImplicitAdditionalProperties": "throw-on-extras",
"controllerPathGlobs": ["./src/controllers/**/*Controller.ts"],
"spec": {
"host": "localhost:3000",
"host": "pet-store-kong-3abae03b4c44.herokuapp.com",
"basePath": "/v1/",
"outputDirectory": "./spec",
"specVersion": 3,
Expand Down

0 comments on commit 84e428a

Please sign in to comment.