Skip to content

Commit bc9c289

Browse files
authored
Merge pull request #15 from Moonshine-IDE/github_action. See #14
Initial GitHub action
2 parents 9e5703b + 05a0981 commit bc9c289

6 files changed

Lines changed: 213 additions & 0 deletions

File tree

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Test in Private Super.Human.Installer instance
2+
3+
# Optional feature to automatically build and import your agents into a local Domino instance created with Super.Human.Installer
4+
# Setup: See README for more info
5+
# - Create a Super.Human.Installer instance
6+
# - Setup a private GitHub self-hosted runner on your instance
7+
# - Populate the secrets in the evn section
8+
# - Commit a change to your repository, and the agents will be deployed for testing on your local instance.
9+
10+
11+
on:
12+
workflow_dispatch:
13+
push:
14+
# branches:
15+
# - main
16+
17+
env:
18+
# Instead of setting it here, add PASSWORD=mypass into ~/.bash_profile
19+
#PASSWORD: ${{ secrets.TEST_PASSWORD }}
20+
SERVER: ${{ vars.TEST_SERVER }}
21+
DATABASE: ${{ vars.TEST_DATABASE }}
22+
DOMINO_INSTALLATION: ${{ vars.TEST_DOMINO_INSTALLATION }}
23+
24+
jobs:
25+
setup-database:
26+
runs-on: [self-hosted, super.human.installer]
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
32+
- name: Setup Domino environment
33+
run: |
34+
ln -s /local/notesjava/notes.ini
35+
shell: bash
36+
37+
- name: Verify Domino environment and ID
38+
run: |
39+
whoami
40+
set
41+
echo "Server: '$SERVER'"
42+
echo "Database: '$DATABASE'"
43+
44+
echo "# Check configured server"
45+
ping -c 1 `echo "$SERVER" | sed 's:\(.*\)/.*$:\1:'`
46+
47+
echo "# Check configured user"
48+
java -jar /local/notesjava/CheckNotesUser.jar
49+
shell: bash
50+
51+
# Create an empty database with a default view and permissive ACL
52+
- name: Create empty database
53+
run: |
54+
PASSWORD=password java \
55+
-jar /local/notesjava/CreateDatabase.jar \
56+
$SERVER $DATABASE 2>&1
57+
shell: bash
58+
59+
# Import DXL into the database
60+
# Use HCL Designer to export an existing design element or document to a DXL file.
61+
# You can duplicate this entry for multiple files
62+
- name: Import other design elements or documents using DxlImporter. Repeat for additional files
63+
run: |
64+
PASSWORD=password java \
65+
-jar /local/notesjava/DXLImport.jar \
66+
$SERVER $DATABASE dxl/HelloWorld.dxl 2>&1
67+
shell: bash
68+
69+
- name: Import all agents in to the test database
70+
run: |
71+
# This imports all agents configured in agentProperties using the the custom importAll task in build.gradle
72+
gradle -PnotesIDPassword="${{ secrets.TEST_PASSWORD }}" \
73+
-PnotesInstallation=$DOMINO_INSTALLATION \
74+
-Pserver=$SERVER -PdbName=$DATABASE \
75+
clean importAll 2>&1
76+
shell: bash
77+
78+
# - name: Import a single agent
79+
# run: |
80+
# # This imports a single agent using the generated task in build.gradle
81+
# gradle -PnotesIDPassword="${{ secrets.TEST_PASSWORD }}" \
82+
# -PnotesInstallation=$DOMINO_INSTALLATION \
83+
# -Pserver=$SERVER -PdbName=$DATABASE \
84+
# clean importTestWeb 2>&1
85+
# shell: bash
86+
87+
88+
# TODO: Add any other build tasks to test your application
89+
# Example: Build a Web app and deploy it to the Domino server: /local/notesdata/domino/html/<your-app>

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
.project
66
.settings
77
.svnignore
8+
*.swp
89
bin
910
build
1011
gradle.properties

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,45 @@ To import a single agent or script library, call `import<Name>` where `<Name>` m
6464
gradle importDemoJavaAgent
6565

6666
The `import<Name>` tasks are generated automatically, but you can define your own task if desired. TODO: describe how to override the import or jar tasks
67+
68+
69+
70+
71+
72+
## GitHub Actions
73+
74+
This template includes an example GitHub action. This is designed to support an automated development workflow based on [Super.Human.Installer](https://superhumaninstaller.com/) Domino instances.
75+
1. Make changes to an agent
76+
2. Commit
77+
3. The GitHub Action will:
78+
1. Create an empty database
79+
2. Import any forms, views, documents, etc that you configure
80+
3. Import the agents using `gradle clean importAll`
81+
4. You can then test the agent update on your local machine
82+
83+
### Setup
84+
85+
TODO: Fill in these instructions
86+
87+
1. Create a copy of this repository
88+
89+
2. Create an SHI instance. You can setup a self-hosted runner for this instance on creation (TODO), or install it later
90+
91+
3. In your repository, open `Settings > Secrets and variables > Actions` and set these variables and secrets
92+
93+
Variable | Notes
94+
----------------------------|--------------------
95+
`TEST_SERVER` | The Domino server name. Example: domino-1.acme.com/ACME
96+
`TEST_DATABASE` | The test database name and path.
97+
`TEST_DOMINO_INSTALLATION` | The path to Domino. Should be: `/opt/hcl/domino/notes/latest/linux/`
98+
99+
100+
Secret | Notes
101+
----------------------------|--------------------
102+
`TEST_PASSWORD` | This will be `password` unless you changed it
103+
104+
4. Commit a change to your repository, or trigger the build manually from the Actions tab
105+
106+
5. Test your agent on your instance: `https://%server%/%TEST_DATABASE%/%agent_name%?OpenAgent`
107+
108+
For example: `https://domino-1.acme.com/Test.nsf/HelloWorld?OpenAgent`

agentProperties/TestWeb.properties

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# target location overwritten by properties in build.gradle
2+
$$nsfServer=
3+
$$nsfFile=
4+
# For standard, shared code
5+
$$jarSourceFile=./build/libs/DXLImporter-Gradle-Demo.jar
6+
# for custom build
7+
#$$jarSourceFile=./dist/TestWeb.jar
8+
$$scriptLibrary=
9+
agent_name=TestWeb
10+
agent_runaswebuser=false
11+
agent_clientbackgroundthread=false
12+
agent_allowremotedebugging=false
13+
agent_storehighlights=false
14+
agent_restrictions=unrestricted
15+
agent_hide=v3
16+
agent_publicaccess=false
17+
trigger_type=actionsmenu
18+
documentset_type=runonce
19+
code_event=action
20+
javaproject_class=net.prominic.demo.TestWeb.class
21+
javaproject_codepath=.
22+
javaproject_compiledebug=true
23+
javaproject_imported=true

dxl/HelloWorld.dxl

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version='1.0' encoding='utf-8'?>
2+
<!DOCTYPE database SYSTEM 'xmlschemas/domino_11_0_1.dtd'>
3+
<!-- Example that imports only a single form -->
4+
<!-- remove database properties:
5+
- replicaid
6+
- path
7+
- title
8+
- increatemaxfields
9+
- compressdata
10+
-->
11+
<database xmlns='http://www.lotus.com/dxl' version='11.0' maintenanceversion='1.0' >
12+
<!-- remove databaseinfo -->
13+
<form name='HelloWorld' publicaccess='false' designerversion='8.5.3' renderpassthrough='true'>
14+
<!-- Remove from form:
15+
- noteinfo
16+
- created
17+
- modified
18+
- revised
19+
- lastaccessed
20+
- addedtofile
21+
- updatedby
22+
- wassignedby
23+
-->
24+
<body><richtext>
25+
<pardef id='1'/>
26+
<par def='1'>Hello, World!</par>
27+
<par def='1'/>
28+
<par def='1'>Your first greeting: <field type='text' kind='editable' name='Greeting'/><compositedata
29+
type='98' prevtype='65418' nexttype='222' afterparcount='6' containertype='65418'
30+
aftercontainercount='1' afterbegincount='3'>
31+
Yg4BAIQAAAAAAAAAAAA=
32+
</compositedata></par></richtext></body>
33+
<item name='$$ScriptName' summary='false' sign='true'><text>HelloWorld</text></item></form>
34+
</database>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package net.prominic.demo;
2+
3+
import lotus.domino.*;
4+
5+
/**
6+
* An example of an agent run from the WebQuerySave option on a form.
7+
* This returns a generic XML response.
8+
*/
9+
public class TestWeb extends AgentBase
10+
{
11+
public void NotesMain() {
12+
13+
String message = "This is not yet fully implemented.";
14+
getAgentOutput().println("content-type:application/xml");
15+
//getAgentOutput().println("Pragma:cache");
16+
//getAgentOutput().println("Cache-control:public");
17+
getAgentOutput().println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
18+
getAgentOutput().println("<root>");
19+
// note that this should be encoded in a real agent
20+
getAgentOutput().println("<note>" + message + "</note>");
21+
getAgentOutput().println("</root>");
22+
getAgentOutput().flush();
23+
}
24+
}

0 commit comments

Comments
 (0)