-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ba-st/project-loading
Add scripting for loading rowan projects
- Loading branch information
Showing
11 changed files
with
295 additions
and
31 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
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,21 @@ | ||
# How to load a Rowan project | ||
|
||
`gs64-rowan` images contains some simple scripts to load a Rowan-aware project | ||
from disk located in `ROWAN_PROJECTS_HOME`. Once you have started the image you | ||
can do something like: | ||
|
||
```bash | ||
docker exec -it -e GS64_CI_PROJECT_NAME=Buoy examples-stone-1 ./load-rowan-project.sh | ||
``` | ||
|
||
This will try to use `${ROWAN_PROJECTS_HOME}/Buoy/rowan/specs/Buoy-CI.ston` as the | ||
loading specification. | ||
|
||
The script supports the following configuration: | ||
|
||
- `GS64_CI_PROJECT_NAME` is mandatory and will be used as the folder containing | ||
the project to load | ||
- `GS64_CI_SPEC` is optional. It's the name of the spec file to load. | ||
Defaults to `${GS64_CI_PROJECT_NAME}-CI` | ||
- `GS64_CI_SYSTEM_USER_PASSWORD` is optional. The password for the `SystemUser` | ||
account in the mounted extent. Defaults to `swordfish`. |
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,15 @@ | ||
# How to run tests for a Rowan project | ||
|
||
`gs64-rowan` images contains some simple scripts to run the test of a loaded | ||
Rowan-aware project. Once you have started the image you | ||
can do something like: | ||
|
||
```bash | ||
docker exec -it examples-stone-1 ./run-tests.sh Buoy | ||
``` | ||
|
||
The script supports the following configuration: | ||
|
||
- The only accepted script argument is the rowan-aware project name | ||
- `GS64_CI_SYSTEM_USER_PASSWORD` is optional. The password for the `SystemUser` | ||
account in the mounted extent. Defaults to `swordfish`. |
14 changes: 7 additions & 7 deletions
14
docs/reference/DockerImages.md → docs/reference/docker-images.md
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
# Docker images reference | ||
|
||
## `gs64` base docker image | ||
## `gs64` server docker image | ||
|
||
This container image contains the GemStone/S 64 bits runtime support but doesn't | ||
provide an `extent0.dbf`. Users will need to map a volume against `/opt/gemstone/data/` | ||
containing the relevant data files (extents and transaction logs). | ||
|
||
## `gs64-rowan` docker image | ||
|
||
This container image builds on top of the base image providing the `extent0.rowan.dbf`. | ||
It's a useful target for a CI system. | ||
|
||
## `gs64-rowan-loader` docker image | ||
|
||
This container image builds on top of the rowan image installing also git. | ||
This container image builds on top of the server image providing the `extent0.rowan.dbf` | ||
and a git installation. It's a useful target for a CI system. | ||
In order to use Rowan for cloning and manipulating remote repositories, users | ||
will need to map a volume against `/home/gemstone/.ssh/` containing the | ||
relevant keys. | ||
|
||
## `gs64-base` docker image | ||
|
||
This container image builds on top of the server image providing the `extent0.dbf` |
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
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,73 @@ | ||
set compile_env: 0 | ||
! ------------------- Class definition for StdOutPrinter | ||
expectvalue /Class | ||
doit | ||
Object subclass: 'StdOutPrinter' | ||
instVarNames: #() | ||
classVars: #() | ||
classInstVars: #() | ||
poolDictionaries: #() | ||
inDictionary: Globals | ||
options: #() | ||
|
||
% | ||
! ------------------- Remove existing behavior from StdOutPrinter | ||
expectvalue /Metaclass3 | ||
doit | ||
StdOutPrinter removeAllMethods. | ||
StdOutPrinter class removeAllMethods. | ||
% | ||
set compile_env: 0 | ||
! ------------------- Class methods for StdOutPrinter | ||
category: 'printing' | ||
classmethod: StdOutPrinter | ||
printError: aBlock | ||
|
||
self printLine: [:s | | ||
s << Character esc << '[1m'. | ||
s << Character esc << '[31m'. | ||
aBlock value: s. | ||
s << Character esc << '[0m' | ||
]. | ||
% | ||
category: 'printing' | ||
classmethod: StdOutPrinter | ||
printInfo: aBlock | ||
|
||
self printLine: [:s | | ||
s << Character esc << '[1m'. | ||
s << Character esc << '[34m'. | ||
aBlock value: s. | ||
s << Character esc << '[0m' | ||
]. | ||
% | ||
category: 'printing' | ||
classmethod: StdOutPrinter | ||
printLine: aBlock | ||
|
||
aBlock value: GsFile stdout. | ||
GsFile stdout lf; flush | ||
% | ||
category: 'printing' | ||
classmethod: StdOutPrinter | ||
printSuccess: aBlock | ||
|
||
self printLine: [:s | | ||
s << Character esc << '[1m'. | ||
s << Character esc << '[32m'. | ||
aBlock value: s. | ||
s << Character esc << '[0m' | ||
]. | ||
% | ||
category: 'printing' | ||
classmethod: StdOutPrinter | ||
printWarning: aBlock | ||
|
||
self printLine: [:s | | ||
s << Character esc << '[1m'. | ||
s << Character esc << '[33m'. | ||
aBlock value: s. | ||
s << Character esc << '[0m' | ||
]. | ||
% | ||
! ------------------- Instance methods for StdOutPrinter |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
if [ -z "${GS64_CI_PROJECT_NAME}" ]; then | ||
echo "[ERROR] Missing GS64_CI_PROJECT_NAME variable" | ||
exit 1 | ||
fi | ||
|
||
readonly LOAD_SPEC="${GS64_CI_SPEC:-${GS64_CI_PROJECT_NAME}-CI}" | ||
readonly SYSTEM_USER_PASSWORD="${GS64_CI_SYSTEM_USER_PASSWORD:-swordfish}" | ||
|
||
echo "Loading code in GS..." | ||
echo " Project Name: ${GS64_CI_PROJECT_NAME}" | ||
echo " Load Spec: ${LOAD_SPEC}" | ||
|
||
topaz -i -q <<EOF > "${GEMSTONE_LOG_DIR}/loading-rowan-projects.log" | ||
set gemstone gs64stone user SystemUser pass ${SYSTEM_USER_PASSWORD} | ||
iferror exit 1 | ||
login | ||
doit | ||
|spec url | | ||
url := 'file://${ROWAN_PROJECTS_HOME}/${GS64_CI_PROJECT_NAME}/rowan/specs/${LOAD_SPEC}.ston'. | ||
spec := RwSpecification fromUrl: url. | ||
spec resolve load. | ||
% | ||
commit | ||
logout | ||
exit 0 | ||
EOF | ||
|
||
echo "Loading code in GS... [OK]" |
Oops, something went wrong.