Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor typos fixed in readme. My first contribution and pull request. #4

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
6c33880
export deepsee artefacts now supported
gevorg95 Mar 26, 2018
08b466b
Update README.md
gevorg95 Mar 26, 2018
4db3b48
Update README.md
evshvarov Mar 31, 2018
4dbbd12
Update README.md
evshvarov Mar 31, 2018
dc53d39
move sc to dev, add deepsee class for check source data
gevorg95 Apr 2, 2018
a05de72
move sc to dev
gevorg95 Apr 2, 2018
6d77342
bug fixed
gevorg95 Apr 2, 2018
43e0846
Update deepsee.cls
gevorg95 Apr 2, 2018
7abd1b0
set default setting git = 0, move package name sc to dev
gevorg95 Apr 13, 2018
e1a0373
Update gitLocal.cls
gevorg95 Apr 13, 2018
7d1aafb
set setting git=0
gevorg95 Apr 25, 2018
f4eb2c7
patch bug fixed
gevorg95 May 4, 2018
5f4d049
patch bug fixed
gevorg95 May 8, 2018
48de94f
Update README.md
gevorg95 Jun 10, 2018
6bbc7f8
export gbl bug fixed
gevorg95 Jul 11, 2018
09e12c5
Merge branch 'master' of https://github.com/intersystems-community/is…
gevorg95 Jul 11, 2018
9815afa
bug fixed, add version parameter
gevorg95 Jul 11, 2018
bbab3ec
"add version" fix
gevorg95 Jul 11, 2018
a0431d3
bug fixed
gevorg95 Jul 11, 2018
41384bc
The patch export occurs in the default directory
gevorg95 Jul 19, 2018
6d84057
[ADD] automatic configuration with isc.json
gevorg95 Jul 31, 2018
bd70e2f
filename bug fixed
gevorg95 Sep 11, 2018
46d217a
isc.json example was added
gevorg95 Oct 2, 2018
13ca0fb
import bug was fixed
gevorg95 Oct 2, 2018
b6a169c
Update README.md
gevorg95 Dec 13, 2018
9f80ee6
changes for the development with docker container
Feb 9, 2019
c57ea5e
version was updated
gevorg95 Mar 19, 2019
ad0bdd0
docker ignore added
evshvarov Mar 31, 2019
4155ffa
dockerisation with community edition
evshvarov Apr 13, 2019
85d8062
no need in extra docker file
evshvarov Apr 13, 2019
04950b9
zpm support
daimor Apr 24, 2019
cb4699c
export only dfi files was added
gevorg95 Apr 25, 2019
6bf6f5b
bug was fixed
gevorg95 Apr 26, 2019
a92263b
bug was fixed
gevorg95 Apr 29, 2019
0ebe36b
masks bug was fixed
gevorg95 Apr 29, 2019
4c423eb
Merge pull request #12 from daimor/master
gevorg95 May 3, 2019
ce847a9
Update README.md
gevorg95 May 3, 2019
260f20c
Changed the version in a module.xml for ZPM update
May 12, 2019
590cfe5
added zpm support
May 12, 2019
314a8a6
how to update the package
May 12, 2019
682c748
Update README.md
isc-tlouie Sep 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/.DS_Store
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
ARG IMAGE=intersystems/iris:2019.1.0S.111.0
ARG IMAGE=store/intersystems/iris:2019.1.0.511.0-community
FROM $IMAGE

WORKDIR /opt/app

COPY ./Installer.cls ./
COPY ./cls/ ./src/

# download ZPM
RUN mkdir -p /tmp/deps \

&& cd /tmp/deps \

&& wget -q https://pm.community.intersystems.com/packages/zpm/latest/installer -O zpm.xml


RUN iris start $ISC_PACKAGE_INSTANCENAME quietly EmergencyId=sys,sys && \
/bin/echo -e "sys\nsys\n" \
" Do ##class(Security.Users).UnExpireUserPasswords(\"*\")\n" \
" Do ##class(Security.Users).AddRoles(\"admin\", \"%ALL\")\n" \
" do ##class(Security.System).Get(,.p)\n" \
" set p(\"AutheEnabled\")=\$zb(p(\"AutheEnabled\"),16,7)\n" \
" do ##class(Security.System).Modify(,.p)\n" \
" Do \$system.OBJ.Load(\"/tmp/deps/zpm.xml\", \"ck\")" \
" Do \$system.OBJ.Load(\"/opt/app/Installer.cls\",\"ck\")\n" \
" Set sc = ##class(App.Installer).setup(, 3)\n" \
" If 'sc do \$zu(4, \$JOB, 1)\n" \
" halt" \
| iris session $ISC_PACKAGE_INSTANCENAME && \
/bin/echo -e "sys\nsys\n" \
| iris stop $ISC_PACKAGE_INSTANCENAME quietly

CMD [ "-l", "/usr/irissys/mgr/messages.log" ]
29 changes: 29 additions & 0 deletions Installer.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Class App.Installer
{

XData MyInstall [ XMLNamespace = INSTALLER ]
{
<Manifest>
<Default Name="NAMESPACE" Value="TEST"/>
<Default Name="DBNAME" Value="TEST"/>
<Default Name="APPPATH" Dir="/opt/app/" />
<Default Name="SOURCESPATH" Dir="${APPPATH}src" />
<Default Name="RESOURCE" Value="%DB_${DBNAME}" />

<Namespace Name="${NAMESPACE}" Code="${DBNAME}-CODE" Data="${DBNAME}-DATA" Create="yes" Ensemble="0">
<Configuration>
<Database Name="${DBNAME}-CODE" Dir="${APPPATH}${DBNAME}-CODE" Create="yes" Resource="${RESOURCE}"/>
<Database Name="${DBNAME}-DATA" Dir="${APPPATH}${DBNAME}-DATA" Create="yes" Resource="${RESOURCE}"/>
</Configuration>

<Import File="${SOURCESPATH}" Recurse="1"/>
</Namespace>

</Manifest>
}

ClassMethod setup(ByRef pVars, pLogLevel As %Integer = 3, pInstaller As %Installer.Installer, pLogger As %Installer.AbstractLogger) As %Status [ CodeMode = objectgenerator, Internal ]
{
Quit ##class(%Installer.Manifest).%Generate(%compiledclass, %code, "MyInstall")
}
}
63 changes: 47 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,49 @@
# cache-udl
Export/Import sources in UDL format for [ISC Caché 2016.2](http://www.intersystems.com/our-products/cache/cache-overview/)
# ISC-DEV

[![Gitter](https://img.shields.io/badge/chat-on%20telegram-blue.svg)](https://t.me/joinchat/FoZ4MxGETT0_VsVglVl0DA)

Export/Import source code (classes, macro, routines) and DeepSee artifacts (pivots, dashboards, termlists, pivot variables, shared measures) from and to InterSystems Data Platform products (Caché, Ensemble, IRIS). Support versions from 2016.2.

# Installation
Download code and run
```
set dir="/dir/cache-udl
do $System.OBJ.ImportDir(dir,"*.xml;*.cls;*.mac;*.int;*.inc;*.dfi","ck",,1)
set dir="/your_download_dir/isc-dev
do $System.OBJ.ImportDir(dir,"*.xml;*.cls;*.mac;*.int;*.inc;*.dfi","cuk",,1)
```
or
import the [release](https://github.com/intersystems-ru/cache-udl/releases) to the namespace.

Map sc package to %All namespace to make it visible in any namespace.
Map the sc package to the %All namespace to make it visible in any namespace.

# Usage

## Setup working directory ( optional )
```
NS> w ##class(sc.code).workdir("/path/to/your/working/directory/")
NS> w ##class(dev.code).workdir("/path/to/your/working/directory/")
```
## Export to working directory:
```
NS> d ##class(sc.code).export()
NS> d ##class(dev.code).export()
```
## Import:
```
NS> d ##class(sc.code).import()
NS> d ##class(dev.code).import()
```

## Compile, Release and Patch:

Introduce isc.json file in the source root directory with settings for the code mask, for the name of the project and for get the patch form local git or GitHub. e.g.
```
"git": 0 - files diff from local git
"git": 0 - files diff from local git (default)
"git": 1 - files diff from GitHub
use below params in case of "git" : 1
"owner": - name of the github e.g. intersystems-community
"repository": - name of the repo e.g. dc-analytics
"user": - user and password for private github repo
"password":
```


```
isc.json
"compileList": "Classes*.INC,classes*.CLS,*.DFI",
Expand All @@ -47,25 +56,47 @@ isc.json
```
Run init method to initialize project settings:
```
NS> d ##class(sc.code).init()
NS> d ##class(dev.code).init()
```
Then run release to export all the classes in comileList into one "myproject.xml" release file. It will export it into the default for current Namespace directory.
Then run release() to export all the classes in compileList into one "myproject.xml" release file. It will export it into the default directory for the current Namespace.
```
NS> d ##class(sc.code).release()
NS> d ##class(dev.code).release()
```
Or compile it whenever you want to compile all the proejct related resources.
Or compile it whenever you want to compile all the project related resources.
```
NS> d ##class(sc.code).compile()
NS> d ##class(dev.code).compile()
```
Get last changes from github or local git. Run patch to export the classes in comileList into one "patch.xml" patch file. It will export it into the default for current Namespace directory or you can choose where export. By default, makes a patch from the last commit if you do not specify `commitFrom` and `commitTo` e.g.
Get the latest changes from github or local git. Run patch() to export the classes in compileList into one "patch.xml" patch file. It will export it into the default directory for the current Namespace or you can choose the export dir. By default, it makes a patch from the last commit if you do not specify `commitFrom` and `commitTo` e.g.
```
NS> s filename = "c:\patch.xml"
NS> s commitFrom = 1
NS> s commitTo = 5
NS> d ##class(sc.code).patch(filename,commitFrom,commitTo)
NS> d ##class(dev.code).patch(filename,commitFrom,commitTo)
```

## Known issues
Be careful with import termlists, pivot variables and shared measures. In the current implementation, imported artifacts replace those you have in the target namespace. It happens because the utility uses standard global import for globals in XML with $System.OBJ.Import which kills the global first and imports the new one.

#### If after using the export command, git treats unaltered files as modified, the problem may be in the following:
- When moving sources from one OS to another (e.g., from win to mac), the end of the line character was not taken into account. To fix this, you need to specify git to make the end of line character look the same.

solution: ```git config --global core.autocrlf input```
- File access rights have been changed. In this case, you will need to specify that you do not want to track these changes.

solution: ```git config core.filemode false```

## Development

To update the module in ZPM do the following:
USER> zpm
zpm: USER>load /opt
zpm: USER>repo -n registry -user USER -pass PASSWORD
1) Filesystem
2) Local Cache
3) Remote Repository

Which sort of repository do you wish to configure? 3
zpm: USER>module-action isc-dev publish



Expand Down
Loading