diff --git a/scripts/build_app.sh b/scripts/build_app.sh index 475625c7..182c4856 100755 --- a/scripts/build_app.sh +++ b/scripts/build_app.sh @@ -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 \ @@ -63,3 +66,5 @@ if [ "$PUBLISH" = true ]; then fi docker logout + +end_group "Building container ..." diff --git a/scripts/setup_workspace.sh b/scripts/setup_workspace.sh index 0f5aed7c..d1855aee 100755 --- a/scripts/setup_workspace.sh +++ b/scripts/setup_workspace.sh @@ -38,13 +38,14 @@ 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 @@ -52,17 +53,25 @@ else 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" @@ -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 ..."