Skip to content

Commit

Permalink
wip: more ci
Browse files Browse the repository at this point in the history
  • Loading branch information
robinbourianes-kalisio committed Feb 20, 2024
1 parent 2e9e9c1 commit 2330cbb
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 24 deletions.
7 changes: 2 additions & 5 deletions scripts/build_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ while getopts "p" option; do
esac
done

### Init workspace
###
## Init workspace
##

WORKSPACE_DIR="$(dirname "$ROOT_DIR")"
init_app_infos "$ROOT_DIR" "$WORKSPACE_DIR/development/workspaces/apps"
Expand All @@ -33,9 +33,6 @@ FLAVOR=$(get_app_flavor)

echo "About to build ${APP} v${VERSION}-$FLAVOR ..."

## Load project env
##

. "$WORKSPACE_DIR/development/workspaces/apps/apps.sh" kapp

## Build container
Expand Down
34 changes: 26 additions & 8 deletions scripts/build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,45 @@ set -euo pipefail
# set -x

THIS_FILE=$(readlink -f "${BASH_SOURCE[0]}")
THIS_PATH=$(dirname "$THIS_FILE")
ROOT_PATH=$(dirname "$THIS_PATH")
THIS_DIR=$(dirname "$THIS_FILE")
ROOT_DIR=$(dirname "$THIS_DIR")

. "$THIS_PATH/kash/kash.sh"
. "$THIS_DIR/kash/kash.sh"

## Parse options
##

PUBLISH=false
while getopts "p" option; do
case $option in
while getopts "p" OPT; do
case $OPT in
p) # defines mongo version
PUBLISH=true;;
*)
;;
esac
done

## Init workspace
##

WORKSPACE_DIR="$(dirname "$ROOT_DIR")"

## Build docs
##

# Build process requires node 18
use_node 18

rm .postcssrc.js && cd docs && yarn install && yarn build
rm -f .postcssrc.js && cd docs && yarn install && yarn build

if [ "$PUBLISH" = true ]; then
# deploy_gh_pages
echo "publish !"
load_env_files "$WORKSPACE_DIR/development/common/KAPP_PUSH_DOC_TOKEN.enc.env"

GIT_COMMIT_SHA=$(get_git_commit_sha "$ROOT_DIR")
GIT_AUTHOR=$(get_git_commit_author "$ROOT_DIR")
deploy_gh_pages \
"https://oauth2:$KAPP_PUSH_DOC_TOKEN@github.com/kalisio/kApp.git" \
"$ROOT_DIR/docs/.vitepress/dist" \
"$GIT_AUTHOR" \
"Docs built from $GIT_COMMIT_SHA"
fi
6 changes: 3 additions & 3 deletions scripts/init_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ set -euo pipefail
JOB_ID=$1

THIS_FILE=$(readlink -f "${BASH_SOURCE[0]}")
THIS_PATH=$(dirname "$THIS_FILE")
ROOT_PATH=$(dirname "$THIS_PATH")
THIS_DIR=$(dirname "$THIS_FILE")
# ROOT_DIR=$(dirname "$THIS_DIR")

. "$THIS_PATH/kash/kash.sh"
. "$THIS_DIR/kash/kash.sh"

### Github Actions

Expand Down
2 changes: 1 addition & 1 deletion scripts/kash
Submodule kash updated 1 files
+38 −30 kash.sh
11 changes: 4 additions & 7 deletions scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ while getopts "m:n:" option; do
esac
done

### Init workspace
###
## Init workspace
##

WORKSPACE_DIR="$(dirname "$ROOT_DIR")"
init_app_infos "$ROOT_DIR" "$WORKSPACE_DIR/development/workspaces/apps"
Expand All @@ -36,6 +36,8 @@ FLAVOR=$(get_app_flavor)

echo "About to run tests for ${APP} v${VERSION}-($FLAVOR) ..."

. "$WORKSPACE_DIR/development/workspaces/apps/apps.sh" kapp

## Start mongo
##

Expand All @@ -46,11 +48,6 @@ k-mongo

end_group "Starting mongo $MONGO_VER ..."

## Load project env
##

. "$WORKSPACE_DIR/development/workspaces/apps/apps.sh" kapp

## Run tests
##

Expand Down
3 changes: 3 additions & 0 deletions scripts/setup_workspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ ROOT_DIR=$(dirname "$THIS_DIR")

. "$THIS_DIR/kash/kash.sh"

## Parse options
##

WORKSPACE_BRANCH=
WORKSPACE_TAG=
WORKSPACE_NODE=16
Expand Down

0 comments on commit 2330cbb

Please sign in to comment.