1:: «
GLI».1

1:: « GLI». 1

1

: 1

: 2

: 2

4

4

5

1 5

5

9

13

14

15

17

19

19

21

22

22

GitLab API 23

« GLI» 24

« »: 25

: 27

28

Git Git «» . 28

28

28



Gitlab CI/CD . - . , Git, . . , — . ( , ) , .


:



:



:





, :

:

Фигура3

* :

**

*** , , . , , . Windows :
REGEDIT4

HKEY_CLASSES_ROOT\e1c]
@="URL:e1c Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\e1c\DefaultIcon]
@="\"C:\\Program Files (x86)\\1cv82\\common\\1cestart.exe\""

[HKEY_CLASSES_ROOT\e1c\shell]

[HKEY_CLASSES_ROOT\e1c\shell\open]

[HKEY_CLASSES_ROOT\e1c\shell\open\command]
@="\"C:\\Program Files (x86)\\1cv82\\common\\1cestart.exe\" /url \"%1\""


, .


: , , sqlcmd MS-SQL.

: " "

, : , , : /, /, .

: , . , sqlcmd, Windows CMD  DOS OEM 866.

.

...

, . .
...

: , , (runners) GitLab. .


,
"\" "/"
Linux.

: :
W:\SQLData\

/var/lib/pgpro/1c-11/data/base/


1

1, .

  FDQN, , , , .


:

1. MyServer.MyDomain.MyZone (FDQN)

2. MyServer ,

3. MyServer:1641 -


: – , , .

:  

:  


, .

" ":
GLI_.(), , .

GLI_.(), , . " ". - , , - . . , . , .

GLI_.(), , , , , . .

GLI_.(),

GLI_.(),     


  -  " "


RAS:

RAS:


, , / CI. 

, , , , , . 

()   :

, : , , .


  , (.  " ") . 

MS SQL: sqlcmd -S ~!ServerName -U ~!UserName -P ~!Password -h -1 -b -Q "SELECT name FROM master.dbo.sysdatabases", ServerName, UserName, Password - .  " ":

ServerName

...

UserName

...

Password

...


. " " .

, "", ( , , ) .

, :

-

,

" [] ", . , drag & drop.

" " " " 

:
:  , , .

- , , .  ""

-

,

, , (), , , , . .

 - "" - , .

( , ) Git. 

, . , , . , , .

" "

  . ( ), . " " .

, .

, . .  

, , , (. )

-


, "MainDB"   ,  
"TP/00-00000077", "MainDB.TP.00-00000077"

-

, .

(. ) .

( )

-

, , , .

.

-

, , .

 "MainDB.TP.00-00000077.ThisYear"  "MainDB.TP.00-00000077.LastYear"

 - ,

-

.

1,  

 " 1", 1, .

 "", ,

 " ", "". ,

" "

,

, [A-Za-z--0-9_]+

1, .

, : - " ", - (Stage) , -  " ", , , .

" "

, " " " " ,  sqlcmd -S ~!ServerName -U ~!UserName -P ~!Password -u -s "~!Delimiters" -h -1 -d ~!DBName -b -Q "SELECT type,name,physical_name FROM sys.database_files"  , 1, , MS-SQL , . , " "



" " : , , . . , (, , ).

, 1 , , .

() : 

RAS . 

- " " , .

- " " (ENTERPRISE)

" , " , . , , : " " .

, , - .

yml.

HTTP GetPipeLine. 

Gitlab , push, merge-request HTTP .

,

.

,  Gitlab include, , , ( ), Gitlab CI .


  .gitlab-ci.yml :


include: 

    - 'http://gitlab.test.ru/sppr/hs/GetPipeline/CI_YML_TEST/ci-module.yml' 

 CI_YML_TEST -   , sppr/hs  HTTP , . , http , , IIS Windows - GitLab .

!  , :

500 - Internal server error.

There is a problem with the resource you are looking for, and it cannot be displayed.

" " . , , , -, , - Gitlab . ( ).


, Gitlab CI/CD :

Pipeline cannot be run.

Included file `http://gitlab.test.ru/sppr/hs/GetPipeline/CI_YML_TEST/ci-module.yml` does not have valid YAML syntax!

" " CI Iint:  CI/CD/Pipelines/CI lint.

- , YML, . 
. :

" " (stages). , , , , , .

:

stages:

    - ~!Stages


, , , :


StagesAndVariables

Lock

Copy

GetCF

Fetching

Convertation

Build

TestQQ

Update

Unlock

OnFailureUnlock


 StagesAndVariables


stages:

    - ~!Stages


:


# StagesAndVariables

stages:

    - StagesAndVariables

    - Lock

    - Copy

    - GetCF

    - Fetching

    - Convertation

    - Build

    - TestQQ

    - Update

    - Unlock

    - OnFailureUnlock


 [\w\d_]+, .. , .

    

!  , BUILD Build. 1 .


, .
, , ( ) .


, , , , EDT-->1:


# 1

.job_template: &~!Stage_job

    tags: 

        - convertation

    variables:

        GIT_STRATEGY: none

    script:

        - chcp 65001

        - start "" /wait "%W_PLATFORM_1C%" DESIGNER /S %%  /N %USER_1C% /P %PASS_1C%  /UC UpdateDB /DisableStartupMessages /DisableStartupDialogs /DisableSplash /UpdateCfg %CI_PROJECT_DIR%\%UpdFile% /UpdateDBcfg -Dynamic- /Out %CI_PROJECT_DIR%\logs\%LOG_NAME%


, , ,  * - Git, , , , , . "" , . 

, * :

ConvertEDT_XML_~!JobSuffix: 

    <<: *~!stage_job

    stage: ~!Stage

    dependencies: []

    only:

        refs:

        - ~!Ref

        changes:

        - TEST-CONF/src/**/*


:

ConvertEDT_XML_~!Ref: 

    <<: *~!stage_job

    stage: ~!Stage

    dependencies: []

    only:

        refs:

        - ~!Ref

        changes:

        - TEST-CONF/src/**/*

        variables:

        - $CI_PIPELINE_SOURCE == 'web'


, , , . 

, , GitLab.


~! , . , . , . , , Windows CMD: %DATABASENAME%, Windows PowerShell &DATABASENAME, Linux bash $DATABASENAME,


variables:
      variables:
           - 
DATABASENAME: ~!DATABASENAME

, , . 

 
StagesStageRef . , " ", .


" " yml, , Gitlab CD/CI CI Lint .


, 1:. 

(. ) .. 1 

* " ", **:

, . " "


 - "Delimiters", " ", " " " "

__________________

* , . . , -.

** , " "


, .


" " " " " "


" ", *. , , .


, " " . . MS-SQL Postgre SQL. 


, "." " " ., , " "


"" , " ". 


!  , " " " " .


"" "", , , ,  .GLI_.**, :

.GLI_.( , "SourceLogicalDBLogName", .2);

- ., , -

" "


:

GLI_.(,), 

: 1,2...N

!  , , .

, .

- , , , BS (). 

- , .

_____________________

* , .
** " ", ... , .



() . 

-  " "  YAML  " "

, ~! , , .  [A-Za-z--0-9_]+. :

copy ~!_1.txt ~!\

delete ~!DbName_2.mdf

" " , :

_1

DbName_2

"" " " , . " " , . , , (stage) . , , , . 

" " 1:, , . :
- " ", "" , , , "" - " ", , .
! 

" ". YAML . , . , , (refs Git) only: refs:. , " " . , . " ". YAML , . 

 JobSuffix, . :

[  ]

(..,"/",".")

[V]

"United"


, , "United":

, Stub, "JustOneLine":

ConvertEDT_XML_~!JobSuffix: 

    <<: *convertation_job

    stage: ~!Stage

    dependencies: []

    variables:

        STUB: '~!Stub'

    only:

        refs:

        - ~!Ref

        changes:

        - TEST-CONF/src/**/*

:

ConvertEDT_XML_United
    <<: *convertation_job
    stage: Convertation
    dependencies: []

    variables:

        STUB: 'JustOneLine'

    only:
        refs:
       
 - master
        - TP/00-00000256
        - Tst/102
        changes:
        - TEST-CONF/src/**/*

 Stub : ( ()), :

ConvertEDT_XML_CI_YML_TEST: 

    <<: *convertation_job

    stage: Convertation

    variables:

        STUB: '0a09ca20-8f4a-48f7-8110-e6f2a8303a93'

    dependencies: []

    only:

        refs:

        - master

        changes:

        - cpm/src/**/*

ConvertEDT_XML_CYT.TP.00-00000256

    <<: *convertation_job

    stage: Convertation

    variables:

        STUB: 'c2000413-49d1-4b7f-a954-534421cad798'

    dependencies: []

    only:

        refs:

        - TP/00-00000256

        changes:

        - cpm/src/**/*

ConvertEDT_XML_CYT.Tst.102

    <<: *convertation_job

    stage: Convertation

    variables:

        STUB: '86418d3c-9e00-4229-bdb0-a7e2fe9bcb4c'

    dependencies: []

    only:

        refs:

        - Tst/102

        changes:

        - cpm/src/**/*

, Stub 2 " ", " " :

ConvertEDT_XML_United
    <<: *convertation_job
    stage: Convertation
    dependencies: []

    variables:

        STUB: ' '

    only:
        refs:
        
- master
        - TP/00-00000256
        - Tst/102
        changes:
        - TEST-CONF/src/**/*

. , , , :

, . " ():". :

 

"", , " ":

:

, :

, , .

, ( ) .

, , , .


, , " ", "" "" ""

" , " " "



. " ", .. . , :

*

-**

*

-***

 *

** "" " ", " "  ( " ")   , " "

*** .


:

:

"" - , . , , .

Фигура4 !  , " ", , , , , . , " " .

""     . 

, "" " ". (diff) , , ( , ). 

, , :



:


, . , , , "" "" ( ) , . . . "detached pipe" . . . " Git" , , ( ), . 


, :

, . 


. RDef, , , "" . 


.


GitLab API

(), id Gitlab, Gitlab   .


. , " " " "

Фигура5 !  , , .

" " , , . Apache, - .

. IIS


Фигура6 , HTTP , , . , sppr https://my_server.ru/sppr http - http , sppr_api https://my_server.ru/sppr_api. , API , ( ( , HTTP REST ) ). , . 

, Gitlab WebHooks: https://my_server.ru/sppr_api/hs/BS/file.json

Gitlab Settings/Webhooks. URL http- BS .  Push eventsMerge request events, Pipeline events.  SSL .  Add webhook.

,  Test/Push events. Gitlab push SHA  origin/master  .  JSON, , origin/master - API . , Edit, , , , - JSON. JSON "". !  JSON , .

 https://my_server.ru/sppr_api/hs/GetPipeline/PipelineOfMyProject/ci-module.yml,  PipelineOfMyProject - " "


  , , , , . , GitLAB .

gitlab API :

« GLI»

. , :

  1. Git . Git , .

  2. , ( «» « » « » « » « » « »), «» «», « ». «» «» ( ) , :

    , , « »:

    :

    :

    1. «» «» « », , «»

    2. , .

    3. «» « » .

  3. «» , , , , / , , .


« »:

, .

, ( ) .

:

.

, , . , , , , . , . , ( , ) ( «», ).

.

, . « , ( ) .» , . , , « » , . , , , , . : 9.6. , :: 1: 8. « ». 2.0. (1c.ru). ( ) – , . , . , « , » : « » «».

Git Git «» .

, . – Git, . , .

Git. - master . Git . : . Git , – , . (Fetch).

-, «», , «» , . , , «» , :


() . Gitlab.



1 1.0.2.6, 1.0.2.15,