Skip to content

jemaltahir/split-build-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Step-by-Step Deployment

1. Create Builder Image

oc new-build https://github.com/<your-user>/split-build-demo.git \
  --name=builder-demo \
  --strategy=docker \
  --context-dir=builder

2. Create App Build

oc new-build https://github.com/<your-user>/split-build-demo.git \
  --name=app-demo \
  --strategy=docker

This will fail withy error:

STEP 2/7: WORKDIR /app
--> ea50c7cd1e01
STEP 3/7: COPY /deps /usr/local
error: build error: building at STEP "COPY /deps /usr/local": checking on sources under "/tmp/build/inputs": copier: stat: "/deps": no such file or directory

The following pathc needed to fix to find the source image builder context.

3. Connect Builder → App (Cache Reuse)

oc patch bc app-demo --type='merge' -p '{
  "spec": {
    "source": {
      "images": [
        {
          "from": {
            "kind": "ImageStreamTag",
            "name": "builder-demo:latest"
          },
          "paths": [
            {
              "sourcePath": "/deps",
              "destinationDir": "."
            }
          ]
        }
      ]
    }
  }
}'

4. Build App

oc start-build app-demo --follow

5. Deploy Application

oc new-app --image-stream=app-demo:latest --name=app-demo
oc expose deployment app-demo --port=8080

6. Create Route

oc create route edge app-demo \
  --service=app-demo \
  --port=8080

7. Access Application

oc get route

Then:

curl https://<ROUTE_URL>; echo

Expected Output

Hello from split build

Debug Commands

oc logs -f build/app-demo-1
oc get pods
oc describe pod <pod-name>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors