Skip to content
Weik.ioPreview

Preview of the text for github.com/weikio/weikio/tree/main/examples. The service shows it in its own layout.

weikio/weikioPublic

weikio / examples /

 mainAdafy OyThe finance examples and the hello integration for 2026.2.122 files
  • hello/The integration weikio init hello writes
  • hello/hello.camel.yamlA timer that logs a line every 5 seconds
    - route:
        id: hello
        from:
          uri: timer:hello?period=5000
          steps:
            - setBody:
                simple: "{{message}}"
            - to: log:hello
    
  • hello/application.propertiesThe message the route logs
    message=hello from weikio
    
  • hello/integration.yamlThe name, with the other fields as commented examples
    name: hello
    # version: 0.1.0
    # camelVersion: "4.22.x"
    # requirements: { os: linux }
    # dependencies:
    #   - camel:jdbc
    
  • finance/The project, its default values and what runs in each environment
  • finance/project.yamlThe project, created once by a platform administrator
    apiVersion: weik.io/v1
    kind: project
    metadata: { name: finance }
    spec:
      displayName: Finance
      description: Invoices between the ERP, the suppliers and the partners
    
  • finance/variables/erp-url.yamlThe ERP address that every environment uses unless it has its own
    apiVersion: weik.io/v1
    kind: variable
    metadata: { name: erp-url, project: finance }
    spec: { value: https://erp-test.example.internal }
    
  • finance/devtest/deployments/erp-invoice-export.yamlWhat runs in devtest
    apiVersion: weik.io/v1
    kind: deployment
    metadata: { name: erp-invoice-export, project: finance, environment: devtest }
    spec: { version: 1.1.0, state: started }
    
  • finance/production/deployments/erp-invoice-export.yamlWhat runs in production, changed by a promotion pull request
    apiVersion: weik.io/v1
    kind: deployment
    metadata: { name: erp-invoice-export, project: finance, environment: production }
    spec: { version: 1.1.0, state: started }
    
  • finance/production/variables/erp-url.yamlThe production ERP address, which overrides the default in production
    apiVersion: weik.io/v1
    kind: variable
    metadata: { name: erp-url, project: finance, environment: production }
    spec: { value: https://erp.example.internal }
    
  • finance/erp-invoice-export/A Camel integration that sends each new invoice to the ERP
  • finance/erp-invoice-export/integration.yamlIts version and Camel line
    name: erp-invoice-export
    version: 1.1.0
    camelVersion: "4.22.1"
    requirements: { os: linux }
    
  • finance/erp-invoice-export/application.propertiesThe folder the billing system writes invoices to
    invoice-inbox=/var/lib/weikio/finance/invoices
    
  • finance/erp-invoice-export/routes/export-invoices.camel.yamlPosts each invoice to the ERP, counts it and publishes it
    - route:
        id: export-invoices
        from:
          uri: "file:{{invoice-inbox}}?include=.*\\.json&move=.done"
          steps:
            - setHeader:
                name: Content-Type
                constant: application/json
            - setHeader:
                name: Authorization
                simple: "Bearer {{erp-api-key}}"
            - to: "{{erp-url}}/api/invoices"
            - to: micrometer:counter:invoices_processed
            - to: "kamelet:weikio-event-sink?channel=invoice-created"
    
  • finance/transfers/A transfer of supplier invoices every morning at 05:00 UTC
  • finance/transfers/supplier-invoices.yamlMoves the PDFs from the supplier's FTP server to Azure Blob Storage
    apiVersion: weik.io/v1
    kind: mft
    metadata: { name: supplier-invoices, project: finance }
    spec:
      schedule: "0 0 5 * * ?"
      source:      { remote: supplier-ftp,    path: /outgoing }
      destination: { remote: invoice-archive, path: invoices/incoming }
      operation: move
      filters: ["*.pdf"]
    
  • finance/variables/supplier-ftp.yamlThe supplier's FTP server, with its password in a secret
    apiVersion: weik.io/v1
    kind: variable
    metadata: { name: supplier-ftp, project: finance }
    spec:
      value: |
        type = ftp
        host = ftp.supplier.example
        user = weikio
        pass = {{supplier-ftp-password}}
    
  • finance/variables/invoice-archive.yamlThe Azure storage account, with its key in a secret
    apiVersion: weik.io/v1
    kind: variable
    metadata: { name: invoice-archive, project: finance }
    spec:
      value: |
        type = azureblob
        account = financearchive
        key = {{invoice-archive-key}}
    
  • finance/apis/invoices/The invoices API with version v1 and a partner subscription
  • finance/apis/invoices/invoices.yamlThe API and its version v1 in front of the ERP
    apiVersion: weik.io/v1
    kind: api
    metadata: { name: invoices, project: finance }
    spec: { displayName: Invoice API, prefix: /invoices }
    ---
    apiVersion: weik.io/v1
    kind: api-version
    metadata: { name: v1, project: finance, api: invoices }
    spec:
      type: proxy
      rateLimit: { permitLimit: 600, window: 1m }
      routes:
        - RouteId: pending
          Match: { Path: "/{**rest}" }
          ClusterId: erp
      clusters:
        - ClusterId: erp
          LoadBalancingPolicy: RoundRobin
          Destinations:
            erp: { Address: "{{erp-url}}/api/invoices" }
    
  • finance/production/apis/partner-x.yamlAn API key for one partner in production, 60 calls a minute
    apiVersion: weik.io/v1
    kind: api-subscription
    metadata: { name: partner-x, project: finance, environment: production }
    spec:
      apis: [invoices]
      type: apikey
      rateLimit: { permitLimit: 60, window: 1m }
    
  • finance/invoice-created/A channel and the integration that receives its events
  • finance/invoice-created/invoice-created.yamlThe channel erp-invoice-export publishes to
    apiVersion: weik.io/v1
    kind: event-channel
    metadata: { name: invoice-created, project: finance }
    spec:
      description: One event per invoice created in the ERP, JSON body
    
  • finance/invoice-created/invoice-archiver/routes/archive.camel.yamlReceives each event from the channel and writes it to the archive folder
    - route:
        id: archive-invoices
        from:
          uri: "kamelet:weikio-event-source?channel=invoice-created"
          steps:
            - to: "file:{{archive-dir}}"
    
  • finance/invoice-created/invoice-archiver/application.propertiesThe archive folder
    archive-dir=/var/lib/weikio/finance/archive
    
  • .github/workflows/GitHub Actions workflows for devtest and production
  • .github/workflows/plan.yamlShows what a pull request would change in devtest
    name: plan
    on:
      pull_request:
        paths: ['finance/**']
    env:
      WEIKIO_SERVER: https://weikio.example.com
    jobs:
      plan:
        runs-on: ubuntu-latest
        environment: devtest
        env:
          WEIKIO_API_KEY: ${{ secrets.WEIKIO_API_KEY }}
        steps:
          - uses: actions/checkout@v4
          - run: |
              curl -fsSL https://weik.io/install.sh | WEIKIO_CLI_VERSION=2026.2.1 sh
              echo "$HOME/.local/bin" >> "$GITHUB_PATH"
          - run: >
              weikio diff --env devtest --prune finance
              -f ./finance/erp-invoice-export -f ./finance/transfers -f ./finance/apis
              -f ./finance/invoice-created -f ./finance/devtest
              || [ $? -eq 2 ]
    
  • .github/workflows/devtest.yamlApplies the folder to devtest after a merge
    name: devtest
    on:
      push:
        branches: [main]
        paths: ['finance/**']
    env:
      WEIKIO_SERVER: https://weikio.example.com
    jobs:
      apply:
        runs-on: ubuntu-latest
        environment: devtest
        env:
          WEIKIO_API_KEY: ${{ secrets.WEIKIO_API_KEY }}
        steps:
          - uses: actions/checkout@v4
          - run: |
              curl -fsSL https://weik.io/install.sh | WEIKIO_CLI_VERSION=2026.2.1 sh
              echo "$HOME/.local/bin" >> "$GITHUB_PATH"
              echo "WEIKIO_REASON=$(git log -1 --format=%s)" >> "$GITHUB_ENV"
          - run: >
              weikio apply --env devtest --prune finance -y
              -f ./finance/erp-invoice-export -f ./finance/transfers -f ./finance/apis
              -f ./finance/invoice-created -f ./finance/devtest
    
  • .github/workflows/production.yamlApplies to production after the required reviewers approve
    name: production
    on:
      push:
        branches: [main]
        paths: ['finance/**']
    env:
      WEIKIO_SERVER: https://weikio.example.com
    jobs:
      plan:
        runs-on: ubuntu-latest
        environment: production-plan
        env:
          WEIKIO_API_KEY: ${{ secrets.WEIKIO_API_KEY }}
        steps:
          - uses: actions/checkout@v4
          - run: |
              curl -fsSL https://weik.io/install.sh | WEIKIO_CLI_VERSION=2026.2.1 sh
              echo "$HOME/.local/bin" >> "$GITHUB_PATH"
          - run: weikio diff -f ./finance/production --env production --prune finance || [ $? -eq 2 ]
      apply:
        needs: plan
        runs-on: ubuntu-latest
        environment: production
        env:
          WEIKIO_API_KEY: ${{ secrets.WEIKIO_API_KEY }}
        steps:
          - uses: actions/checkout@v4
          - run: |
              curl -fsSL https://weik.io/install.sh | WEIKIO_CLI_VERSION=2026.2.1 sh
              echo "$HOME/.local/bin" >> "$GITHUB_PATH"
              echo "WEIKIO_REASON=$(git log -1 --format=%s)" >> "$GITHUB_ENV"
          - run: weikio apply -f ./finance/production --env production --prune finance -y
    
README.md

Examples

These folders are the examples of the Weik.io docs, the University videos and the live demo. hello is the integration that weikio init hello writes, and finance is a project with one example of each kind: a Camel integration, a transfer, an API and a channel.

The finance folder is laid out for GitOps. The documents every environment shares sit in their own folders, and devtest/ and production/ contain what differs per environment. project.yaml and variables/ belong to a platform administrator, because they change every environment at once.

Apply them to your own installation

  1. Install the CLI and sign in to your hub. The install line needs curl and ca-certificates, which minimal images such as debian:12 don't have, so install them there first with apt-get install -y curl ca-certificates:

    curl -fsSL https://weik.io/install.sh | sh
    weikio login https://hub.example.com
  1. As a platform administrator, create the project and its default values:

    weikio apply -f ./finance/project.yaml -f ./finance/variables
  1. Set the secrets the examples read. Each command asks for the value with hidden input:

    weikio secret set finance/erp-api-key --env devtest
    weikio secret set finance/supplier-ftp-password --env devtest
    weikio secret set finance/invoice-archive-key --env devtest
  1. Apply the shared folders and the devtest folder, which publishes a version of each integration and starts erp-invoice-export in devtest:

    weikio apply --env devtest --prune finance \
      -f ./finance/erp-invoice-export -f ./finance/transfers -f ./finance/apis \
      -f ./finance/invoice-created -f ./finance/devtest

To run the same steps from GitHub Actions, copy .github/workflows/ to the root of your own repository, set WEIKIO_SERVER in the workflows to your hub's address, and add a WEIKIO_API_KEY secret to the GitHub environments devtest, production-plan and production. Each key needs the deployer role on finance in its own environment only, and production gets required reviewers. Promotion is then a pull request that changes the version in finance/production/deployments/erp-invoice-export.yaml.

The guide to keeping integrations in Git is https://weik.io/docs/deliver/gitops.