Giter Site home page Giter Site logo

isc-shuliu / zapm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sergeymi37/zapm

0.0 0.0 0.0 8.71 MB

zapm is a shell - extends the zpm shell and adds any other commands. #MSW

License: MIT License

Pawn 10.71% Dockerfile 0.31% ObjectScript 88.97%

zapm's Introduction

Repo-GitHub OEX-zapm

Docker-ports

zapm

Gitter Demo Habr

GitHub last commit Quality Gate Status

ZAPM is a shell - extends the ZPM shell and adds any other commands.

Working in the terminal I got tired of going from my shell to the zpm shell and back. My shell was supplied with additional specific commands and I decided to merge the two shells.

The ZAPM checks if the command entered is a ZPM command, then sends the execution to the ZPM shell. Then I wanted to improve the color commands and expand the functionality. And now ZAPM has survived to the first version and can add any command that I need and remember it so that I can re-execute it.

What's new

Added command: pick

This is an analogue of the find and install command for viewing and loading packages from alternative sources directly from the repositories.

ZAPM commands extention:


pick <context>

  • Pick modules by name or context and load from repository.
  • Pick -u Upgrade load from repository.
  • Pick -a Output all information from the OEX repository.
  • Pick -n Displaying all OEX repo information reverse sorted by publication date.
  • Pick -n 15 Displaying all repo information from OEX older than 15 days.
  • Pick -p </dir/filename.log> Output all information from the OEX repository to a file.

Installation with ZPM

If the current ZPM instance is not installed, then in one line you can install the latest version of ZPM even with a proxy.

s r=##class(%Net.HttpRequest).%New(),proxy=$System.Util.GetEnviron("https_proxy") Do ##class(%Net.URLParser).Parse(proxy,.pr) s:$G(pr("host"))'="" r.ProxyHTTPS=1,r.ProxyTunnel=1,r.ProxyPort=pr("port"),r.ProxyServer=pr("host") s:$G(pr("username"))'=""&&($G(pr("password"))'="") r.ProxyAuthorization="Basic "_$system.Encryption.Base64Encode(pr("username")_":"_pr("password")) set r.Server="pm.community.intersystems.com",r.SSLConfiguration="ISC.FeatureTracker.SSL.Config" d r.Get("/packages/zpm/latest/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c") zn "%SYS" zpm "install zapm"

Or install native from repo latest betta version

s r=##class(%Net.HttpRequest).%New(),proxy=$System.Util.GetEnviron("https_proxy") Do ##class(%Net.URLParser).Parse(proxy,.pr) s:$G(pr("host"))'="" r.ProxyHTTPS=1,r.ProxyTunnel=1,r.ProxyPort=pr("port"),r.ProxyServer=pr("host") s:$G(pr("username"))'=""&&($G(pr("password"))'="") r.ProxyAuthorization="Basic "_$system.Encryption.Base64Encode(pr("username")_":"_pr("password")) set r.Server="github.com",r.SSLConfiguration="ISC.FeatureTracker.SSL.Config" d r.Get("/intersystems-community/zpm/releases/download/v0.4.1-beta.9/zpm-0.4.1-beta.9.xml"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c")

If ZPM is installed, then ZAPM can be set with the command

zpm:USER>install zapm

or install native fpom repo with latest version

zpm:USER>install https://github.com/SergeyMi37/zapm

Installation with Docker

Prerequisites

Make sure you have git and Docker desktop installed.

Installation

Clone/git pull the repo into any local directory

$ git clone https://github.com/SergeyMi37/zapm.git

Open the terminal in this directory and run:

$ docker-compose build

Run the IRIS container with your project:

$ docker-compose up -d

How to Test it

Open IRIS terminal:

$ docker-compose exec iris iris session iris
USER>
USER>zapm "cmd"

Command extensions zpm.

help - coloring command description

load <https...git-repo> - loading the module directly from the git-repository

show modules with context by repository URL

Additional commands.

Commands for working with databases and namespaces:

dbcreate - create a database with %DB resources ans namespace and interoperability mapping.

USER>zapm "dbcreate testdb3 -p d:/!/database/durable"

dbdelete - delete a database with %DB resources ans namespace.

USER>zapm "dbdelete testdb3"

cmd - list of possible additional commands

hist - list of executed commands

newdb -creating a database with a scope and installing the module there

To add a new command to the zapm shell, use the ##class(%ZAPM.ext.zapp).addcmd For example, let's execute sequentially

  • create a database with the area and install the zpmshow module there
hp-msw>IRISZPM>USER> newdb zpmshow

Creating Database zpmshow... done!
Creating Namespace zpmshow... done!
Creating Interoperability mappings ... done!
Adding Interoperability SQL privileges ... done!
Creating CSP Application ... done!
 
zpm "install zpmshow"
[zpmshow]       Reload START
[zpmshow]       Reload SUCCESS
[zpmshow]       Module object refreshed.
[zpmshow]       Validate START
[zpmshow]       Validate SUCCESS
[zpmshow]       Compile START
[zpmshow]       Compile SUCCESS
[zpmshow]       Activate START
[zpmshow]       Configure START
[zpmshow]       Configure SUCCESS
[zpmshow]       Activate SUCCESS

  • add a new command named zshow, which should be executed immediately.
do ##class(%ZAPM.ext.zapp).addcmd("new $namespace zn ""zpmshow"" do ^zpmshow", "zpm", "i", "zshow", "Show a zpm modules with extention description")
added

  • check the execution of the new command from the system shell USER>zapm "zshow"
  • or from the zapm shell

Added commands: Working with Products and Tasks, start and stop in all namespaces.

 interoperability
    Alias: prod
 Group work with all Products, info status, start and stop.

 prod list
  Show all namespaces and productions.

 prod only
  Show only productions.

 prod save
  Save the current status for subsequent recovery after the start. Those products that worked will work, and those that did not work will not.

 prod stop
  Remember the current state of all products, and then stop everything

 prod start
  start all products
 prod recover
  Recover all products
 task
 Group work with all custom tasks, info status, suspend and resume.

 task list
  View all tasks and their statuses.

 task save
  Save the current status for subsequent recovery after the start. Those tasks that worked will work, and those that did not work will not.

 task stop
  Suspend all users tasks.

 task start
  Resume all users tasks.

This solution can replace not only the zpm shell but also the main terminal shell. For me it almost happened ;-)

zapm's People

Contributors

sergeymi37 avatar bot avatar isc-shuliu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.