I
I
Igor2021-01-13 03:54:53
GitLab
Igor, 2021-01-13 03:54:53

Gitlab CI/CD how to deliver an artifact to my server?

I want to make my life a little easier and automate some processes.

Description of my task:

There is a project on Gitlab vue ui
When I do a push to a turnip, I want to launch the mechanisms for building and delivering ready-made code to the production server.

What I already have.

gitlab-runnerInstalled and authorized.

I spied an example on the off site vue, pushed it into a turnip and as a result the assembly is completed.

pages: # задание должно быть именованными страницами
  image: node:latest
  stage: deploy
  script:
    - npm ci
    - npm run build
    - mv public public-vue # GitLab Pages хук для каталога public
    - mv dist public # переименование каталога dist (результат команды npm run build)
    # опционально, можно активировать поддержку gzip с помощью следующей строки:
    - find public -type f -regex '.*\.\(htm\|html\|txt\|text\|js\|css\)$' -exec gzip -f -k {} \;
  artifacts:
    paths:
      - public # путь к артефакту должен быть /public для GitLab Pages
  only:
    - develop


Now I can download artifacts.
How to actually finish and deliver the artifact to the right folder on the server?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor, 2021-01-14
@IgorPI

It's funny, in order to deliver content to the server, I have nothing to do and it's unnecessary.
gitlab-runnerHe will do everything himself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question