Skip to content

Commit

Permalink
Add bom.json and dependencies.txt to CPI CRS air-gapped container ima…
Browse files Browse the repository at this point in the history
…ge (#234)

Updated Makefile to auto populate version, registry, git-sha values in the template copies of bom.json and dependencies.txt and add them to the cpi-crs-airgapped image.

----
Signed-off-by: Aritra Sen <[email protected]>
Co-authored-by: Aritra Sen <[email protected]>
  • Loading branch information
rocknes authored Mar 10, 2023
1 parent 953b7aa commit 4b0f350
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ REGISTRY?="harbor-repo.vmware.com/vcloud"

crs-artifacts-prod:
sed -e "s/\.__GIT_COMMIT__//g" -e "s/__VERSION__/$(version)/g" artifacts/default-cloud-director-ccm-crs-airgap.yaml.template > artifacts/cloud-director-ccm-crs-airgap.yaml.template
sed -e "s/\.__GIT_COMMIT__//g" -e "s/__VERSION__/$(version)/g" -e "s~__REGISTRY__~$(REGISTRY)~g" artifacts/dependencies.txt.template > artifacts/dependencies.txt
sed -e "s/\.__GIT_COMMIT__//g" -e "s/__VERSION__/$(version)/g" -e "s~__REGISTRY__~$(REGISTRY)~g" artifacts/bom.json.template > artifacts/bom.json
docker build -f ./artifacts/Dockerfile . -t cpi-crs-airgapped:$(version)
docker tag cpi-crs-airgapped:$(version) $(REGISTRY)/cpi-crs-airgapped:$(version)
docker push $(REGISTRY)/cpi-crs-airgapped:$(version)

crs-artifacts-dev:
sed -e "s/__GIT_COMMIT__/$(GITCOMMIT)/g" -e "s/__VERSION__/$(version)/g" artifacts/default-cloud-director-ccm-crs-airgap.yaml.template > artifacts/cloud-director-ccm-crs-airgap.yaml.template
sed -e "s/__GIT_COMMIT__/$(GITCOMMIT)/g" -e "s/__VERSION__/$(version)/g" -e "s~__REGISTRY__~$(REGISTRY)~g" artifacts/dependencies.txt.template > artifacts/dependencies.txt
sed -e "s/__GIT_COMMIT__/$(GITCOMMIT)/g" -e "s/__VERSION__/$(version)/g" -e "s~__REGISTRY__~$(REGISTRY)~g" artifacts/bom.json.template > artifacts/bom.json
docker build -f ./artifacts/Dockerfile . -t cpi-crs-airgapped:$(GITCOMMIT)
docker tag cpi-crs-airgapped:$(GITCOMMIT) $(REGISTRY)/cpi-crs-airgapped:$(GITCOMMIT)
docker push $(REGISTRY)/cpi-crs-airgapped:$(GITCOMMIT)
Expand Down
6 changes: 4 additions & 2 deletions artifacts/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
FROM scratch
COPY /artifacts/cloud-director-ccm-crs-airgap.yaml.template /src/artifact/
ENTRYPOINT ["/bin/sh"]
COPY ./artifacts/cloud-director-ccm-crs-airgap.yaml.template \
./artifacts/dependencies.txt \
./artifacts/bom.json /src/artifact/
ENTRYPOINT ["/bin/sh"]
20 changes: 20 additions & 0 deletions artifacts/bom.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name":"cpi-crs-airgapped",
"version":"__VERSION__.__GIT_COMMIT__",
"components": {
"manifests":[
{
"name": "cloud-director-ccm-crs-airgap.yaml.template",
"url": ""
}
],
"binaries": [],
"dependencies": [
{
"name":"cloud-provider-for-cloud-director",
"version":"__VERSION__.__GIT_COMMIT__",
"imageRepository":"__REGISTRY__"
}
]
}
}
1 change: 1 addition & 0 deletions artifacts/dependencies.txt.template
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__REGISTRY__ cloud-provider-for-cloud-director __VERSION__.__GIT_COMMIT__

0 comments on commit 4b0f350

Please sign in to comment.