{"id":20571336,"url":"https://github.com/fluent-ci-templates/microcks-pipeline","last_synced_at":"2025-04-14T17:06:43.293Z","repository":{"id":224480255,"uuid":"762950293","full_name":"fluent-ci-templates/microcks-pipeline","owner":"fluent-ci-templates","description":"Import API specifications into Microcks and run Microcks tests","archived":false,"fork":false,"pushed_at":"2024-06-18T16:09:28.000Z","size":169,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T17:06:35.725Z","etag":null,"topics":["api","api-testing","continuous-integration","contract-testing","deno","docker","microcks","mocking","testing","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fluent-ci-templates.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-25T06:29:18.000Z","updated_at":"2024-09-09T21:08:53.000Z","dependencies_parsed_at":"2024-06-17T18:21:32.364Z","dependency_job_id":null,"html_url":"https://github.com/fluent-ci-templates/microcks-pipeline","commit_stats":null,"previous_names":["fluent-ci-templates/microcks-pipeline"],"tags_count":8,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent-ci-templates%2Fmicrocks-pipeline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent-ci-templates%2Fmicrocks-pipeline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent-ci-templates%2Fmicrocks-pipeline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluent-ci-templates%2Fmicrocks-pipeline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluent-ci-templates","download_url":"https://codeload.github.com/fluent-ci-templates/microcks-pipeline/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248923766,"owners_count":21183953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-testing","continuous-integration","contract-testing","deno","docker","microcks","mocking","testing","typescript"],"created_at":"2024-11-16T05:15:57.764Z","updated_at":"2025-04-14T17:06:43.263Z","avatar_url":"https://github.com/fluent-ci-templates.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Microcks Pipeline\n\n[![fluentci pipeline](https://shield.fluentci.io/x/microcks_pipeline)](https://pkg.fluentci.io/microcks_pipeline)\n![deno compatibility](https://shield.deno.dev/deno/^1.41)\n[![dagger-min-version](https://shield.fluentci.io/dagger/v0.11.7)](https://dagger.io)\n[![](https://jsr.io/badges/@fluentci/microcks)](https://jsr.io/@fluentci/microcks)\n[![ci](https://github.com/fluent-ci-templates/microcks-pipeline/actions/workflows/ci.yml/badge.svg)](https://github.com/fluent-ci-templates/microcks-pipeline/actions/workflows/ci.yml)\n\nA ready-to-use CI/CD Pipeline for importing API specifications into [Microcks](https://microcks.io/) and running [Microcks](https://microcks.io/) tests.\n\n## 🚀 Usage\n\nRun the following command:\n\n```bash\nfluentci run microcks_pipeline\n```\n\nOr, if you want to use it as a template:\n\n```bash\nfluentci init -t microcks\n```\n\nThis will create a `.fluentci` folder in your project.\n\nNow you can run the pipeline with:\n\n```bash\nfluentci run .\n```\n\n## 🧩 Dagger Module\n\nUse as a [Dagger](https://dagger.io) module:\n\n```bash\ndagger install github.com/fluent-ci-templates/microcks-pipeline@main\n```\n\nCall a function from the module:\n\n```bash\n# Import API specifications into Microcks\ndagger call import-api-specs --src . \\\n          --specification-files $SPECIFICATION_FILES \\\n          --microcks-url $MICROCKS_URL \\\n          --keycloak-client-id $KEYCLOAK_CLIENT_ID \\\n          --keycloak-client-secret KEYCLOAK_CLIENT_SECRET\n\n# Run Microcks tests\ndagger call run-tests --api-name-and-version \"$API_NAME_AND_VERSION\" \\\n--test-endpoint $TEST_ENDPOINT \\\n--runner $RUNNER \\\n--microcks-url $MICROCKS_URL \\\n--keycloak-client-id $KEYCLOAK_CLIENT_ID \\\n--keycloak-client-secret KEYCLOAK_CLIENT_SECRET\n```\n\n## 🛠️ Environment variables\n\n| Variable          | Description               | Default    |\n| ----------------- | ------------------------- | ---------- |\n| SPECIFICATION_FILES | The path to the API specifications |  |\n| MICROCKS_URL | Microcks instance API endpoint |  |\n| KEYCLOAK_CLIENT_ID | Keycloak Realm Service Account ClientId |  |\n| KEYCLOAK_CLIENT_SECRET | Keycloak Realm Service Account ClientSecret |  |\n| API_NAME_AND_VERSION | The name and version of the API to test |  |\n| TEST_ENDPOINT | The endpoint to test |  |\n| RUNNER | Test strategy (one of: HTTP, SOAP, SOAP_UI, POSTMAN, OPEN_API_SCHEMA, ASYNC_API_SCHEMA, GRPC_PROTOBUF, GRAPHQL_SCHEMA) | `HTTP` |\n| WAIT_FOR | Time to wait for test to finish (int + one of: milli, sec, min) | `5sec` |\n| SECRET_NAME | The name of a Secret to use for connecting test endpoint |  |\n| FILTERED_OPERATIONS | JSON that allows to filter a list of operations to launch a test for |  |\n\n\n## ✨ Jobs\n\n| Job              | Description                               |\n| ---------------- | ----------------------------------------- |\n| import-api-specs | Import API specifications into Microcks   |\n| run-tests        | Launch a Microcks test on an API endpoint |\n\n```typescript\nimportApiSpecs(\n  src: string | Directory,\n  specificationFiles: string,\n  microcksURL: string,\n  keycloakClientId: string,\n  keycloakClientSecret: string | Secret\n): Promise\u003cstring\u003e;\n\nrunTests(\n  apiNameAndVersion: string,\n  testEndpoint: string,\n  microcksURL: string,\n  keycloakClientId: string,\n  keycloakClientSecret: string | Secret,\n  runner = \"HTTP\",\n  waitFor = \"5sec\",\n  secretName?: string,\n  filteredOperations?: string,\n  operationsHeaders?: string\n): Promise\u003cstring\u003e;\n```\n\n## 👨‍💻 Programmatic usage\n\nYou can also use this pipeline programmatically:\n\n```ts\nimport { importApiSpecs, runTests } from \"jsr:@fluentci/microcks\";\n\nawait importApiSpecs(\n    \".\",\n    Deno.env.get(\"SPECIFICATION_FILES\")!,\n    Deno.env.get(\"MICROCKS_URL\")!,\n    Deno.env.get(\"KEYCLOAK_CLIENT_ID\")!,\n    Deno.env.get(\"KEYCLOAK_CLIENT_SECRET\")!\n);\n\nawait runTests(\n    Deno.env.get(\"API_NAME_AND_VERSION\")!,\n    Deno.env.get(\"TEST_ENDPOINT\")!,\n    Deno.env.get(\"MICROCKS_URL\")!,\n    Deno.env.get(\"KEYCLOAK_CLIENT_ID\")!,\n    Deno.env.get(\"KEYCLOAK_CLIENT_SECRET\")!,\n    Deno.env.get(\"RUNNER\")!,\n    Deno.env.get(\"WAIT_FOR\"),\n    Deno.env.get(\"SECRET_NAME\"),\n    Deno.env.get(\"FILTERED_OPERATIONS\")\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluent-ci-templates%2Fmicrocks-pipeline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluent-ci-templates%2Fmicrocks-pipeline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluent-ci-templates%2Fmicrocks-pipeline/lists"}