-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed common docker dependency and added version and changelog (#13)
- Loading branch information
1 parent
57881e1
commit 09caffb
Showing
7 changed files
with
137 additions
and
35 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
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,7 @@ | ||
## 1.0.0 | ||
|
||
- CHANGELOG.md and VERSION added | ||
- Break THE BIG docker dependency and new tiny Dockerfile created for this project specifically | ||
- Fixed github actions | ||
- Added some helper scripts | ||
|
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,40 @@ | ||
FROM ubuntu:22.04 | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
USER root | ||
|
||
RUN apt-get update && \ | ||
apt-get -y upgrade && \ | ||
apt-get -y --no-install-recommends install \ | ||
build-essential \ | ||
git \ | ||
git-core \ | ||
git-lfs \ | ||
python3-dbg \ | ||
python3-dev \ | ||
python3-pip \ | ||
python3-pexpect \ | ||
python3-git \ | ||
python3-jinja2 \ | ||
python3-subunit \ | ||
vim \ | ||
cmake \ | ||
gcc-multilib \ | ||
g++-multilib \ | ||
software-properties-common \ | ||
language-pack-en-base \ | ||
wget \ | ||
clang-format \ | ||
unzip && \ | ||
apt-get -y clean | ||
|
||
RUN git config --global --add safe.directory /workspace | ||
|
||
RUN cd / && mkdir thirdparty && \ | ||
git clone https://github.com/dogusyuksel/embedded_linting.git /thirdparty/linting && \ | ||
git clone https://github.com/STMicroelectronics/OpenOCD.git /thirdparty/openocd && \ | ||
git clone https://github.com/dogusyuksel/ti_cc2640r2f_sdk.git /thirdparty/ti_cc2640r2f_sdk | ||
|
||
CMD ["/bin/bash"] | ||
|
||
WORKDIR /workspace/ |
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,2 @@ | ||
1.0.0 | ||
|
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,67 @@ | ||
#!/bin/bash | ||
|
||
if [ "$#" -eq 1 ]; then | ||
if [ "$1" = "-h" ]; then | ||
echo "USAGE:" | ||
echo " '-b' to build new docker (optional)" | ||
echo " '-c <command>' to run command (optional)" | ||
echo " '-s' to execute docker in root (optional)" | ||
exit 0 | ||
fi | ||
fi | ||
|
||
PWD=`pwd` | ||
BASENAME=`basename "$PWD"` | ||
preferred_name=$BASENAME":latest" | ||
|
||
# Default values: | ||
build_docker=false | ||
is_sudo=false | ||
command="" | ||
|
||
# It's the : after d that signifies that it takes an option argument. | ||
|
||
while getopts bsc: opt; do | ||
case $opt in | ||
b) build_docker=true ;; | ||
s) is_sudo=true ;; | ||
c) command=$OPTARG ;; | ||
*) echo 'error in command line parsing' >&2 | ||
exit 1 | ||
esac | ||
done | ||
|
||
shift "$(( OPTIND - 1 ))" | ||
|
||
"$build_docker" && echo 'Got the -b option' | ||
"$is_sudo" && echo 'Got the -s option' | ||
printf 'Option -c: %s\n' "$command" | ||
|
||
if [ "$build_docker" = "true" ]; then | ||
docker build -t $preferred_name . | ||
fi | ||
|
||
docker images | grep $BASENAME | ||
if [ "$?" -ne 0 ]; then | ||
echo "it means there is no built docker, cannot proceed" | ||
exit 1 | ||
fi | ||
|
||
# here, we probably have the docker, then run it | ||
|
||
if [ "$command" != "" ]; then | ||
echo "command running" | ||
if [ "$is_sudo" = "true" ]; then | ||
docker run --rm -t --net=host -v $(pwd):/workspace --entrypoint=/bin/bash $preferred_name -c "$command" | ||
else | ||
docker run --rm -t --net=host -v $(pwd):/workspace -v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro -u $(id -u ${USER}):$(id -g ${USER}) --entrypoint=/bin/bash $preferred_name -c "$command" | ||
fi | ||
exit 0 | ||
fi | ||
|
||
# if no command run, lets start the docker for personal use | ||
if [ "$is_sudo" = "true" ]; then | ||
docker run --rm -it --net=host -v $(pwd):/workspace --entrypoint=/bin/bash $preferred_name | ||
else | ||
docker run --rm -it --net=host -v $(pwd):/workspace -v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro -u $(id -u ${USER}):$(id -g ${USER}) --entrypoint=/bin/bash $preferred_name | ||
fi |
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
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,4 @@ | ||
#!/bin/bash | ||
|
||
# important!! first call must have '-b' option | ||
./docker_ctl.sh -b -s -c 'cd /workspace && source environment && cd firmware/ble5_simple_peripheral_cc2640r2lp_app && make -C ./FlashROM_StackLibrary/ clean && make -C ./FlashROM_StackLibrary/ all' |