Skip to content

Commit

Permalink
replace old builder with up-to-date builder (#82)
Browse files Browse the repository at this point in the history
* replace old builder with up-to-date builder, paketo.

* remove the hash broker password in case of ci cd
  • Loading branch information
alperdedeoglu authored Dec 30, 2024
1 parent 890bf43 commit f7bd909
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion code/broker/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ if (process.env.cicd) {
"id": "ba609874-a1da-4f9c-a22b-f61de0c71a9e"
}
]
}`
}`
delete process.env.SBF_BROKER_CREDENTIALS_HASH;
let brokerConfig = { brokerCredentials: { [process.env["BROKER_USER"]]: process.env["BROKER_PASSWORD"] }, catalog: JSON.parse(catalog) }
new Broker(brokerConfig).start()
}
Expand Down
8 changes: 4 additions & 4 deletions deploy/kyma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
"--- RUN LIKE npx --yes cross-env IMAGE_PREFIX=sap-demo npm run build:all ---": "",
"/------------------------/": "",
"build:all": "npm run build:srv && npm run build:db-com && npm run build:router && npm run build:html5-deployer && npm run build:api && npm run build:broker",
"build:srv": "cross-env-shell pack build $IMAGE_PREFIX/susaas-srv --path ../../code/gen/srv --builder paketobuildpacks/builder:base --buildpack gcr.io/paketo-buildpacks/nodejs -e BP_LAUNCHPOINT=./node_modules/@sap/cds/bin/serve.js",
"build:db-com": "cross-env-shell pack build $IMAGE_PREFIX/susaas-db-com --path ../../code/gen/db-com --builder paketobuildpacks/builder:base --buildpack gcr.io/paketo-buildpacks/nodejs -e BP_LAUNCHPOINT=./node_modules/@sap/hdi-deploy/deploy.js",
"build:api": "cross-env-shell pack build $IMAGE_PREFIX/susaas-api --path ../../code/gen/api --builder paketobuildpacks/builder:base --buildpack gcr.io/paketo-buildpacks/nodejs -e BP_LAUNCHPOINT=./node_modules/@sap/cds/bin/serve.js",
"build:broker": "cross-env-shell pack build $IMAGE_PREFIX/susaas-broker --path ../../code/broker --builder paketobuildpacks/builder:base --buildpack gcr.io/paketo-buildpacks/nodejs -e BP_LAUNCHPOINT=./start.js",
"build:srv": "cross-env-shell pack build $IMAGE_PREFIX/susaas-srv --path ../../code/gen/srv --builder paketobuildpacks/builder-jammy-base --buildpack gcr.io/paketo-buildpacks/nodejs -e BP_LAUNCHPOINT=./node_modules/@sap/cds/bin/serve.js",
"build:db-com": "cross-env-shell pack build $IMAGE_PREFIX/susaas-db-com --path ../../code/gen/db-com --builder paketobuildpacks/builder-jammy-base --buildpack gcr.io/paketo-buildpacks/nodejs -e BP_LAUNCHPOINT=./node_modules/@sap/hdi-deploy/deploy.js",
"build:api": "cross-env-shell pack build $IMAGE_PREFIX/susaas-api --path ../../code/gen/api --builder paketobuildpacks/builder-jammy-base --buildpack gcr.io/paketo-buildpacks/nodejs -e BP_LAUNCHPOINT=./node_modules/@sap/cds/bin/serve.js",
"build:broker": "cross-env-shell pack build $IMAGE_PREFIX/susaas-broker --path ../../code/broker --builder paketobuildpacks/builder-jammy-base --buildpack gcr.io/paketo-buildpacks/nodejs -e BP_LAUNCHPOINT=./start.js",
"build:router": "cross-env-shell docker build -t $IMAGE_PREFIX/susaas-router ../../code/router",
"build:html5-deployer": "cross-env-shell docker build -t $IMAGE_PREFIX/susaas-html5-deployer ../../code/app",
"---------------------------": "",
Expand Down
10 changes: 5 additions & 5 deletions docu/2-basic/3-kyma-build-docker-images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ This simplifies the containerization process and allows you to build a Docker Im
**Npm script to build the Docker Image using Paketo** ([*/deploy/kyma/package.json*](../../../deploy/kyma/package.json))

```json
"build:api": "pack build sap-demo/susaas-api --path ../../code/gen/api --builder paketobuildpacks/builder:base --buildpack gcr.io/paketo-buildpacks/nodejs -e BP_LAUNCHPOINT=./node_modules/@sap/cds/bin/cds-serve.js"
"build:api": "pack build sap-demo/susaas-api --path ../../code/gen/api --builder paketobuildpacks/builder-jammy-base --buildpack gcr.io/paketo-buildpacks/nodejs -e BP_LAUNCHPOINT=./node_modules/@sap/cds/bin/cds-serve.js"
```

>**Hint** - The *paketobuildpacks/builder:base* provides a minimal Docker Image based on Ubuntu, with the addition of a few packages (so-called "mixins") ([click here](https://hub.docker.com/r/paketobuildpacks/builder) for more details).
>**Hint** - The *paketobuildpacks/builder-jammy-base* provides a minimal Docker Image based on Ubuntu, with the addition of a few packages (so-called "mixins") ([click here](https://hub.docker.com/r/paketobuildpacks/builder) for more details).

### Backend Service (srv)
Expand All @@ -206,7 +206,7 @@ Doing so (as for the API Service), a Docker Image can be build without having to
**Npm script to build the Docker Image using Paketo** ([*/deploy/kyma/package.json*](../../../deploy/kyma/package.json))

```json
"build:srv": "pack build sap-demo/susaas-srv --path ../../code/gen/srv --builder paketobuildpacks/builder:base --buildpack gcr.io/paketo-buildpacks/nodejs -e BP_LAUNCHPOINT=./node_modules/@sap/cds/bin/cds-serve.js"
"build:srv": "pack build sap-demo/susaas-srv --path ../../code/gen/srv --builder paketobuildpacks/builder-jammy-base --buildpack gcr.io/paketo-buildpacks/nodejs -e BP_LAUNCHPOINT=./node_modules/@sap/cds/bin/cds-serve.js"
```


Expand Down Expand Up @@ -262,7 +262,7 @@ This way (as for the API and SaaS Backend Service), a Docker Image can be build
**Npm script to build the Docker Image using Paketo** ([*/deploy/kyma/package.json*](../../../deploy/kyma/package.json))

```json
"build:broker": "pack build sap-demo/susaas-broker --path ../../code/broker --builder paketobuildpacks/builder:base --buildpack gcr.io/paketo-buildpacks/nodejs -e BP_LAUNCHPOINT=./start.js"
"build:broker": "pack build sap-demo/susaas-broker --path ../../code/broker --builder paketobuildpacks/builder-jammy-base --buildpack gcr.io/paketo-buildpacks/nodejs -e BP_LAUNCHPOINT=./start.js"
```


Expand Down Expand Up @@ -335,7 +335,7 @@ After running the CDS build (compiling the CDS files of our CAP Backend, CAP API
**Npm script to build the Docker Image using Paketo** ([*/deploy/kyma/package.json*](../../../deploy/kyma/package.json))

```json
"build:db-com": "pack build sap-demo/susaas-db-com --path ../../code/gen/db-com --builder paketobuildpacks/builder:base --buildpack gcr.io/paketo-buildpacks/nodejs -e BP_LAUNCHPOINT=./node_modules/@sap/hdi-deploy/deploy.js"
"build:db-com": "pack build sap-demo/susaas-db-com --path ../../code/gen/db-com --builder paketobuildpacks/builder-jammy-base --buildpack gcr.io/paketo-buildpacks/nodejs -e BP_LAUNCHPOINT=./node_modules/@sap/hdi-deploy/deploy.js"
```

Now you should be covered and well in the know about the different approaches used to containerize our SaaS application components. Let us continue with some more details on how to push your Docker Images to your Container Registry now.
Expand Down

0 comments on commit f7bd909

Please sign in to comment.