-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Rifa Achrinza <[email protected]>
- Loading branch information
Showing
6 changed files
with
119 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[submodule "cicd/vendor/setup-db2"] | ||
path = cicd/vendor/setup-db2 | ||
url = https://github.com/achrinza/setup-db2.git | ||
branch = v0.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
export POSIXLY_CORRECT=1 | ||
set -euv | ||
|
||
ORIG_DIR="$(pwd)" | ||
cd "$(dirname "$0")/../.." | ||
BASE_DIR="$(pwd)" | ||
|
||
CI_NODEJS_AUTOINSTALL_DIR="$BASE_DIR/cicd/tmp/nodejs-autoinstall" | ||
PREPARE_POSTINSTALL_SCRIPT="$BASE_DIR/cicd/tmp/well-known/set-env/post-prepare-autoinstall.sh" | ||
|
||
STEP_COUNT=1 | ||
|
||
step () { | ||
printf "\n\n============================================================================\n" | ||
printf 'STEP #%d: %s\n' "$STEP_COUNT" "$1" | ||
printf "\n============================================================================\n\n" | ||
STEP_COUNT="$((STEP_COUNT + 1))" | ||
} | ||
|
||
step 'Bootstrap dependencies' | ||
npm ci --prefer-offline --ignore-scripts | ||
|
||
step 'Pack for autoinstall' | ||
mkdir -p "CI_NODEJS_AUTOINSTALL_DIR" | ||
npm pack --pack-destination="$CI_NODEJS_AUTOINSTALL_DIR" | ||
|
||
mkdir -p "$(dirname "$PREPARE_POSTINSTALL_SCRIPT")" | ||
echo "export CI_NODEJS_AUTOINSTALL_DIR=\"$CI_NODEJS_AUTOINSTALL_DIR\"" >"$PREPARE_POSTINSTALL_SCRIPT" | ||
chmod +x "$PREPARE_POSTINSTALL_SCRIPT" | ||
|
||
cd "$ORIG_DIR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/sh | ||
export POSIXLY_CORRECT=1 | ||
set -euv | ||
|
||
export DB2_USERNAME=db2inst1 | ||
export DB2_PASSWORD=P00lGnorts | ||
export DB2_HOSTNAME=localhost | ||
export DB2_PORTNUM=50000 | ||
export DB2_DATABASE=mydb | ||
|
||
ORIG_DIR="$(pwd)" | ||
cd "$(dirname "$0")/../.." | ||
BASE_DIR="$(pwd)" | ||
|
||
CI_NODEJS_AUTOINSTALL_DIR="${CI_NODEJSAUTOINSTALL_DIR:-}" | ||
STARTDB2_SCRIPT="$BASE_DIR/cicd/vendor/setup-db2/start-db2.sh" | ||
|
||
STEP_COUNT=1 | ||
|
||
step () { | ||
printf "\n\n============================================================================\n" | ||
printf 'STEP #%d: %s\n' "$STEP_COUNT" "$1" | ||
printf "\n============================================================================\n\n" | ||
STEP_COUNT="$((STEP_COUNT + 1))" | ||
} | ||
|
||
step 'Bootstrap dependencies' | ||
npm ci --prefer-offline | ||
|
||
step 'Bootstrap overriding dependencies' | ||
if [ -d "$CI_NODEJS_AUTOINSTALL_DIR" ]; then | ||
find \ | ||
"$CI_NODEJS_AUTOINSTALL_DIR" \ | ||
-iname '*.tgz' \ | ||
-exec \ | ||
npm install {} \; | ||
fi | ||
npm install --prefer-offline | ||
|
||
step 'Start DB2 LUW server' | ||
"$STARTDB2_SCRIPT" \ | ||
-l accept \ | ||
-V "$DB2_VERSION" \ | ||
-p 'P00lGnorts' | ||
|
||
step 'Run tests' | ||
npm run pretest --ignore-scripts | ||
npm test --ignore-scripts | ||
|
||
step 'Teardown DB2 LUW server' | ||
"$STARTDB2_SCRIPT" -C | ||
|
||
cd "$ORIG_DIR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters