1
0
forked from me/IronOS

Decomission of scripts/ci (#1760)

* Decomission of scripts/ci

* Code review

* Update .gitignore according to changes for code review
This commit is contained in:
Ivan Zorin
2023-07-31 03:06:57 +03:00
committed by GitHub
parent 05d0ef66ef
commit e0f373a88a
8 changed files with 23 additions and 29 deletions

2
.gitignore vendored
View File

@@ -186,6 +186,7 @@ fabric.properties
# Binaries
source/Hexfile/
source/Objects/
BUILDS/
# Autogenerated
source/Core/Gen/
@@ -214,4 +215,3 @@ Logo GUI/TS100 Logo Editor/TS100 Logo Editor/bin/
# Tests/linters/sanitizers
source/check-style.log

View File

@@ -9,5 +9,4 @@ services:
dockerfile: scripts/IronOS.Dockerfile
command: /bin/sh
volumes:
- ./scripts/ci:/build/ci:Z
- ./:/build/ironos:Z

View File

@@ -27,6 +27,14 @@ ifndef MKDOCS
MKDOCS:=mkdocs
endif
# build output related directories
ifdef OUT
OUT_DIR=$(OUT)
else
OUT_DIR=$(CURDIR)/BUILDS
endif
OUT_HEX=$(CURDIR)/source/Hexfile
### global static variables
@@ -105,7 +113,7 @@ docker-shell: docker-check $(DOCKER_DEPS)
# former build.sh
docker-build: docker-check $(DOCKER_DEPS)
$(DOCKER_CMD) /bin/bash /build/ci/buildAll.sh
$(DOCKER_CMD) make build-all
# delete container
docker-clean: docker-check
@@ -157,6 +165,17 @@ tests: test-md test-sh test-py test-ccpp
@echo "All tests & checks have been completed successfully."
@echo ""
# former scripts/ci/buildAll.sh - all in one to build all firmware & place the produced binaries into one output directory
build-all:
@mkdir -p $(OUT_DIR)
@chmod 0777 $(OUT_DIR)
cd source && bash ./build.sh
@echo "All Firmware built"
@cp -r $(OUT_HEX)/*.bin $(OUT_DIR)
@cp -r $(OUT_HEX)/*.hex $(OUT_DIR)
@cp -r $(OUT_HEX)/*.dfu $(OUT_DIR)
@echo "Resulting output directory: $(OUT_DIR)"
# pass-through target for Makefile inside source/ dir
%:
$(MAKE) -C source/ $@
@@ -166,6 +185,7 @@ clean-build:
$(MAKE) -C source/ clean-all
rm -Rf site
rm -Rf scripts/ci/artefacts
rm -Rf $(OUT_DIR)
# global clean-up target
clean-full: clean-build docker-clean

View File

@@ -33,4 +33,3 @@ RUN python3 -m pip install ${PIP_PKGS}
RUN git config --global --add safe.directory /build/ironos
COPY . /build/ironos
COPY ./scripts/ci /build/ci

View File

@@ -1,21 +0,0 @@
#!/bin/sh
set -e
set -u
# Init vars
dir_ci="/build/ci"
dir_ironos="/build/ironos"
dir_source="${dir_ironos}/source"
# Prepare output dir
dir_artefacts="${dir_ci}/artefacts"
mkdir -p "${dir_artefacts}"
# Build firmware
cd "${dir_source}"
bash ./build.sh || exit 1
echo "All Firmware built"
# Copy out all the final resulting files we would like to store for the next op
cp -r "${dir_source}"/Hexfile/*.bin "${dir_artefacts}"
cp -r "${dir_source}"/Hexfile/*.hex "${dir_artefacts}"

View File

@@ -1 +0,0 @@
8312c4c91799885f222f663fc81f9a31 gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2

View File

@@ -1 +0,0 @@
add5b6a9b12987d0e72f55a4d2cd0f3b nuclei_riscv_newlibc_prebuilt_linux64_2020.08.tar.bz2

View File

@@ -191,7 +191,7 @@ fi;
if [ -z "${cmd}" ] || [ "${cmd}" = "shell" ]; then
docker_cmd="run --rm builder"
elif [ "${cmd}" = "build" ]; then
docker_cmd="run --rm builder /bin/bash /build/ci/buildAll.sh"
docker_cmd="run --rm builder make build-all OUT=${OUT}"
elif [ "${cmd}" = "clean" ]; then
docker rmi ironos-builder:latest
exit "${?}"
@@ -211,4 +211,3 @@ echo -e "\t* type \"${0} clean\" to delete created container (but not cached dat
echo -e "\n====>>>> ${docker_bin} ${docker_file} ${docker_cmd}\n"
eval "${docker_bin} ${docker_file} ${docker_cmd}"
exit "${?}"