diff --git a/.heliumcli.yml b/.heliumcli.yml deleted file mode 100644 index 03c18055..00000000 --- a/.heliumcli.yml +++ /dev/null @@ -1,20 +0,0 @@ -ansibleCopyrightNameVar: project_developer -ansibleRelativeDir: ansible -branchName: main -copyrightName: Helium Edu -tagRootRelease: false -gitProject: git@github.com:HeliumEdu -hostProvisionCommand: sudo apt-get update && sudo apt-get install -y python && sudo - apt-get -y autoremove -projects: -- platform -- frontend -- www -releaseProjects: [] -projectsRelativeDir: projects -remoteName: origin -serverBinFilename: bin/runserver -updateCopyrightYear: false -versionInfo: - path: conf/configs/common.py - project: platform diff --git a/Makefile b/Makefile index 3af0eed5..09297d16 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ SHELL := /usr/bin/env bash PYTHON_BIN := python -HELIUMCLI_PROJECTS ?= '["platform", "frontend"]' +PROJECTS ?= platform frontend www SKIP_UPDATE ?= 'false' DEV_LOCAL_AWS_REGION ?= 'us-east-2' PLATFORM ?= arm64 @@ -15,7 +15,7 @@ install-reqs: install: install-reqs $(PYTHON_BIN) -m pip install -r requirements.txt - @HELIUMCLI_FORCE_FETCH=True HELIUMCLI_SKIP_UPDATE_PULL=True HELIUMCLI_PROJECTS=$(HELIUMCLI_PROJECTS) helium-cli update-projects + @PROJECTS="$(PROJECTS)" ./bin/update-projects.sh build: install PLATFORM=$(PLATFORM) make -C projects/platform build-docker diff --git a/bin/update-projects.sh b/bin/update-projects.sh new file mode 100755 index 00000000..ed10b68f --- /dev/null +++ b/bin/update-projects.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# +# Clone or update each Helium subproject under projects/, then run +# `make install` in it. + +set -euo pipefail + +GIT_PROJECT="${GIT_PROJECT:-git@github.com:HeliumEdu}" +PROJECTS="${PROJECTS:-platform frontend www}" +PROJECTS_DIR="projects" + +mkdir -p "$PROJECTS_DIR" + +for proj in $PROJECTS; do + echo "$proj" + project_path="$PROJECTS_DIR/$proj" + + if [ ! -d "$project_path/.git" ]; then + echo "Cloning repo to ./$project_path" + git clone "$GIT_PROJECT/$proj.git" "$project_path" + else + (cd "$project_path" && git fetch --tags --prune --force && git pull) + fi + + make install -C "$project_path" + echo "" +done diff --git a/requirements.txt b/requirements.txt index d4467539..ed052b37 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,2 @@ -heliumcli==1.6.38 beautifulsoup4==4.13.4 html2text==2024.2.26 \ No newline at end of file