-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docker step to chef cloud build (#22885)
* Add chef dockerfile * Add script for building chef docker images * Add chef dockerization cloud step * Restyled by whitespace * Restyled by prettier-yaml * Restyled by shellharden * Remove hardcoded values from docker script * Restyled by prettier-yaml * Restyled by shellharden Co-authored-by: Restyled.io <[email protected]>
- Loading branch information
1 parent
bc6b438
commit e017be1
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright (c) 2021 Project CHIP Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
set -e # Exit on any script error. | ||
|
||
OUT_DIRECTORY="$WORKING_DIR/out/" | ||
|
||
# Clean up the out directory before extracting device files | ||
rm -r "$OUT_DIRECTORY"* | ||
|
||
# Extract device files | ||
tar -xf "$TAR_PATH" -C "$OUT_DIRECTORY" | ||
|
||
# Build the docker image | ||
docker build -f "$WORKING_DIR"/dockerfile -t "$IMAGE_NAME":latest -t "$IMAGE_NAME:short-sha_$SHORT_SHA" \ | ||
-t "$IMAGE_NAME:build-id_$BUILD_ID" -t "$IMAGE_NAME:commit-sha_$COMMIT_SHA" -t "$IMAGE_NAME:revision-id_$REVISION_ID" \ | ||
--build-arg DEVICE_NAME="$DEVICE_NAME" . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM debian:bullseye | ||
|
||
ARG DEVICE_NAME | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
libglib2.0-0 && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY examples/chef/out/${DEVICE_NAME} /chef_device | ||
COPY examples/chef/out/${DEVICE_NAME}.map /chef_device.map | ||
COPY examples/chef/out/${DEVICE_NAME}.matter /chef_device.matter | ||
COPY examples/chef/out/${DEVICE_NAME}_hashmeta.yaml /chef_device_hashmeta.yaml | ||
|
||
ENV DBUS_SYSTEM_BUS_ADDRESS="unix:path=/var/run/dbus/system_bus_socket" | ||
|
||
CMD ["/chef_device"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters