AlexRogalskiy/java-patterns

View on GitHub
skaffold.kustomize.yaml

Summary

Maintainability
Test Coverage
apiVersion: skaffold/v2beta28
kind: Config
build:
  local:
    push: false
    tryImportMissing: false
    useDockerCLI: false
    useBuildkit: true
    concurrency: 0
  tagPolicy:
    gitCommit:
      variant: CommitSha
  #        sha256: {}
  artifacts:
    - image: styled-java-patterns
      context: ./
      platforms: ['linux/amd64', 'linux/arm64']
      hooks:
        before:
          - command: ['sh', '-c', './scripts/hook.sh']
            os: [darwin, linux]
            dir: .
          - command: ['cmd.exe', '/C', 'scripts/hook.bat']
            os: [windows]
            dir: .
        after:
          - command: ['sh', '-c', 'docker images $SKAFFOLD_IMAGE --digests']
            os: [darwin, linux]
          - command:
              ['cmd.exe', '/C', 'docker images %SKAFFOLD_IMAGE% --digests']
            os: [windows]
      sync:
        manual:
          - src: 'docs/*'
            dest: /usr/src/app/docs
        hooks:
          before:
            - host:
                command:
                  [
                    'sh',
                    '-c',
                    'echo file changes detected:
                    $SKAFFOLD_FILES_ADDED_OR_MODIFIED',
                  ]
                os: [darwin, linux]
            - host:
                command:
                  [
                    'cmd.exe',
                    '/C',
                    'echo file changes detected:
                    %SKAFFOLD_FILES_ADDED_OR_MODIFIED%',
                  ]
                os: [windows]
          after:
            - container:
                command: ['sh', '-c', 'set -x; kill -HUP 1']
      docker:
        dockerfile: ./distribution/docker-images/dev.Dockerfile
        pullParent: false
        noCache: false
        squash: false

deploy:
  statusCheckDeadlineSeconds: 300
  kustomize:
    paths:
      - 'k8s/overlays/dev'
    hooks:
      before:
        - host:
            command:
              ['sh', '-c', 'echo pre-deploy host hook running on $(hostname)!']
            os: [darwin, linux]
      after:
        - host:
            command:
              ['sh', '-c', 'echo post-deploy host hook running on $(hostname)!']

portForward:
  - resourceType: service
    resourceName: styled-java-patterns
    port: 8000
    address: 127.0.0.1
    localPort: 8000

profiles:
  - name: prod
    activation:
      - kubeContext: docker-desktop
    deploy:
      kustomize:
        paths:
          - 'k8s/overlays/prod'
  - name: staging
    activation:
      - kubeContext: docker-desktop
    deploy:
      kustomize:
        paths:
          - 'k8s/overlays/staging'