Skip to content

Commit

Permalink
chore: pretty logs
Browse files Browse the repository at this point in the history
  • Loading branch information
robinbourianes-kalisio committed Feb 20, 2024
1 parent 2330cbb commit 7f90d9d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
5 changes: 5 additions & 0 deletions scripts/build_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ echo "About to build ${APP} v${VERSION}-$FLAVOR ..."
# kli file is used in container to install, link
KLI_FILE=$(get_app_kli_file)
cp "$KLI_FILE" "$WORKSPACE_DIR/kli.js"

echo "Will use kli file $KLI_FILE to install and link modules ..."

IMAGE_NAME="kalisio/$APP"
IMAGE_TAG="$VERSION-$FLAVOR"

begin_group "Building container ..."

docker login --username "$KALISIO_DOCKERHUB_USERNAME" --password-stdin < "$KALISIO_DOCKERHUB_PASSWORD"
# DOCKER_BUILDKIT is here to be able to use Dockerfile specific dockerginore (app.Dockerfile.dockerignore)
DOCKER_BUILDKIT=1 docker build \
Expand All @@ -63,3 +66,5 @@ if [ "$PUBLISH" = true ]; then
fi

docker logout

end_group "Building container ..."
17 changes: 14 additions & 3 deletions scripts/setup_workspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,40 @@ shift $((OPTIND-1))
WORKSPACE_DIR="${1:-$(dirname "$ROOT_DIR")}"
DEVELOPMENT_DIR="$WORKSPACE_DIR/development"

begin_group "Cloning development repo ..."

if [ "$CI" = true ]; then
# workaround since repo is kApp with a 'A' and in kli file it's kapp with a 'a'
mv "$WORKSPACE_DIR/kApp" "$WORKSPACE_DIR/kapp"
ln -s "$WORKSPACE_DIR/kapp" "$WORKSPACE_DIR/kApp"

# clone development in $WORKSPACE_DIR
git clone --depth 1 "https://$GITHUB_DEVELOPMENT_PAT@github.com/kalisio/development.git" "$DEVELOPMENT_DIR"
DEVELOPMENT_REPO_URL="https://$GITHUB_DEVELOPMENT_PAT@github.com/kalisio/development.git"
else
GIT_OPS=
if [ -n "$WORKSPACE_TAG" ] || [ -n "$WORKSPACE_BRANCH" ]; then
GIT_OPS="--branch ${WORKSPACE_TAG:-$WORKSPACE_BRANCH}"
fi
git clone --depth 1 $GIT_OPS "$GITHUB_URL/kalisio/kApp.git" "$WORKSPACE_DIR/kapp"

git clone --depth 1 "$GITHUB_URL/kalisio/development.git" "$DEVELOPMENT_DIR"
DEVELOPMENT_REPO_URL="$GITHUB_URL/kalisio/development.git"

# unset KALISIO_DEVELOPMENT_DIR because we want kli to clone everyhting in $WORKSPACE_DIR
unset KALISIO_DEVELOPMENT_DIR
fi

# clone development in $WORKSPACE_DIR
git clone --depth 1 "$DEVELOPMENT_REPO_URL" "$DEVELOPMENT_DIR"

end_group "Cloning development repo ..."

# select kli file for dependencies
init_app_infos "$WORKSPACE_DIR/kapp" "$DEVELOPMENT_DIR/workspaces/apps"
KLI_FILE=$(get_app_kli_file)

echo "About to setup workspace using $KLI_FILE ..."

begin_group "Running kli ..."

# clone kli in venv if not there
if [ ! -d "$WORKSPACE_DIR/kli" ]; then
git clone --depth 1 "https://github.com/kalisio/kli.git" "$WORKSPACE_DIR/kli"
Expand All @@ -76,3 +85,5 @@ if [ "$WORKSPACE_FULL" = true ]; then
nvm exec "$WORKSPACE_NODE" node "$WORKSPACE_DIR/kli/index.js" "$KLI_FILE" --link --link-folder "$WORKSPACE_DIR/yarn-links"
fi
cd ~-

end_group "Running kli ..."

0 comments on commit 7f90d9d

Please sign in to comment.