apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
  name: bookinfo
spec:
  components:
    - name: productpage
      type: webservice
      properties:
        image: nocalhost-docker.pkg.coding.net/nocalhost/bookinfo/productpage:latest
        port: 9080
      traits:
        - type: expose
          properties:
            port:
              - 9080
        - type: nocalhost
          properties:
            gitUrl: https://github.com/nocalhost/bookinfo-productpage.git
            image: nocalhost-docker.pkg.coding.net/nocalhost/dev-images/python:3.7.7-slim-productpage-with-pydevd
            shell: "bash"
            workDir: "/opt/work"
            resources:
              limits:
                memory: 1Gi
                cpu: "1"
              requests:
                memory: 512Mi
                cpu: "0.5"
            debug:
              remoteDebugPort: 9009
            hotReload: true
            sync:
              type: send
              filePattern:
                - ./
              ignoreFilePattern:
                - .git
                - .idea
            command:
              run:
                - sh
                - run.sh
              debug:
                - sh
                - debug.sh
            env:
              - name: "foo"
                value: "bar"
            portForward:
              - 39080:9080

    - name: authors
      type: webservice
      properties:
        image: nocalhost-docker.pkg.coding.net/nocalhost/bookinfo/authors:latest
        port: 9080
      traits:
        - type: expose
          properties:
            port:
              - 9080
        - type: nocalhost
          properties:
            gitUrl: https://github.com/nocalhost/bookinfo-authors.git
            image: nocalhost-docker.pkg.coding.net/nocalhost/dev-images/golang:latest
            command:
              run:
                - sh
                - run.sh
              debug:
                - sh
                - debug.sh
            debug:
              remoteDebugPort: 9009

    - name: details
      type: webservice
      properties:
        image: nocalhost-docker.pkg.coding.net/nocalhost/bookinfo/details:latest
        port: 9080
      traits:
        - type: expose
          properties:
            port:
              - 9080
        - type: nocalhost
          properties:
            gitUrl: https://github.com/nocalhost/bookinfo-details.git
            image: nocalhost-docker.pkg.coding.net/nocalhost/dev-images/ruby:2.7.1-slim
            command:
              run:
                - sh
                - run.sh
              debug:
                - sh
                - debug.sh
            sync:
              filePattern:
                - ./
              ignoreFilePattern:
                - .git
                - .idea

    - name: ratings
      type: webservice
      properties:
        image: nocalhost-docker.pkg.coding.net/nocalhost/bookinfo/ratings:latest
        port: 9080
      traits:
        - type: expose
          properties:
            port:
              - 9080
        - type: nocalhost
          properties:
            gitUrl: https://github.com/nocalhost/bookinfo-ratings.git
            image: nocalhost-docker.pkg.coding.net/nocalhost/dev-images/node:12.18.1-slim
            command:
              run:
                - sh
                - run.sh
              debug:
                - sh
                - debug.sh

    - name: reviews
      type: webservice
      properties:
        image: nocalhost-docker.pkg.coding.net/nocalhost/bookinfo/reviews:latest
        port: 9080
      traits:
        - type: expose
          properties:
            port:
              - 9080
        - type: nocalhost
          properties:
            gitUrl: https://github.com/nocalhost/bookinfo-reviews.git
            image: nocalhost-docker.pkg.coding.net/nocalhost/dev-images/java:latest
            command:
              run:
                - sh
                - run.sh
              debug:
                - sh
                - debug.sh
            debug:
              remoteDebugPort: 5005
            sync:
              filePattern:
                - ./
              ignoreFilePattern:
                - .git
                - .idea
                - .gradle
                - build
