GitLab CI configuration



  • Good night.

    I'm developing applications for C#.Net 4.0 as a version control system using gitlab 8.8.5, which has been installed on Ubuntu. There is now a need for CI. Set all necessary gitlab-ci-multi-runner. A ranner for the project. Added to the root the master of the branch a file of gitlab-ci.yml, it's going to be fine. I can't configurate correctly. .gitlab-ci.yml(what needs to be added) for the construction of my project and for the other server. Server has no Internet connection.



  • To understand what's in .gitlab-ci.ymlI'd rather start with a very simple one. https://gitlab.com/groups/pages

    For example, lektor configuration:

    image: python:2.7
    pages:
      script:
      - pip install lektor
      - lektor build --output-path public
      artifacts:
        paths:
        - public
      only:
      - master
    
    • image - it's a doker's image you're taking to base.
    • pages - it's just a phase name. You can build, test or deploy, or something.
    • What's launched, you're recording in. script♪ It's just team one by one as if you'd set them up on the command line.
    • artifacts - it's from where to take the binarys.
    • With help only and except It is possible to flexibly fill the stage for the beam only in this branch or, accordingly, for the head to all branches other than the specified
    • If you have any secret keys, you don't need to put them in. .gitlab-ci.yml♪ There's a Variables section in your project design.

    So you'll get hit first, then you'll have to make it. stages:

    stages:
      - build
      - deploy
    

    If stages If you don't ask, the steps will be carried out in parallel, i.e., the decoupling will not depend on whether or not it's lost.

    @marsel-arduanov gave you a good reference, but there's a lot of things, and you're not gonna go anywhere.

    In the end, your configuration might look like,

    image: microsoft/dotnet
    stages:
      - build
      - deploy
    build:
      script:
      - <your command 1 to build>
      - <your command 2 to build>
      artifacts:
        paths:
        - build
    deploy:
      script:
      - <your command to deploy>
      only:
      - master
    

    For a situation where there is no Internet, you can use built-in http://docs.gitlab.com/ce/administration/container_registry.html to take his image.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2