H
H
hAh0L2019-02-08 13:01:24
git
hAh0L, 2019-02-08 13:01:24

How to setup GitLab Runner for deploy on Windows 7 and 10?

Good day!
There are a number of machines running Windows 7 and 10, all x64.
There is a process of developing some software in Lua, Python within GitLab.
Each software has its own separate project. Projects contain sources (*.py/*.lua) and compiled binaries.
When distributed using GitLab Runner, it clones the entire repository. How to prevent sources from getting on target machines?
Now a branch release has been created for this, where the source texts have been removed. Accordingly, when pushing, the task is launched:

stages:
  - deploy
to_machine_one:
  only:
    refs:
      - release
  tags:
    - to_machine_one
  stage: deploy
  script:
    - set DEST_DIR=C:\stat
    - IF not exist %DEST_DIR% (mkdir %DEST_DIR%)
    - xcopy dist C:\stat /Q /R /Y
to_machine_two:
  only:
    refs:
      - release
  tags:
    - to_machine_two
  stage: deploy
  script:
    - set DEST_DIR=C:\stat
    - IF not exist %DEST_DIR% (mkdir %DEST_DIR%)
    - xcopy dist C:\stat /Q /R /Y

This path is inconvenient due to the need to develop in the master branch, compile, switch to release and move the binary from master:
git checkout master dist/someprogram.exe
And accordingly, this path is probably wrong. How is it actually worth preventing the sources from getting on the machine?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2019-02-08
@hAh0L

Divide the process into 2 stages:

  1. First, run locally on the runner, collect artifacts
  2. The second you deliver these artifacts to the servers

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question