0

I am new to gitlab CI/CD and I'm struggling to figure this out.

All I want to do is when I push to dev branch I want my react app to be built and the folder ./build to be pushed through SSH to my dev server.

Here is what I did so far, including a screenshot of the error message I get.

This is my gitlab-ci.yml

image: node:latest

cache:
  paths:
    - node_modules/

build_dev:
  stage: build
  environment: Development
  only: 
    - dev
  script:
    - ls
    - npm install
    - npm run build
  artifacts:
    paths:
      - build/
      - ecosystem.config.js

deploy_dev:
  stage: deploy
  environment: Development
  only:
    - dev
  script:
    - rsync -r -a -v -e ssh --delete "./build" [email protected]:/var/www/gitlab/${CI_PROJECT_NAME}
    - rsync -r -a -v -e ssh --delete "./ecosystem.config.js" [email protected]:/var/www/gitlab/${CI_PROJECT_NAME}/
    - ssh [email protected] "cd /var/www/gitlab/${CI_PROJECT_NAME} && pm2 start ecosystem.config.js"

I don't know why I am getting this output with job failed

enter image description here

1
  • it seems a DNS problem could not resolve host: gitlab.teledirectgroup.com Commented Aug 2, 2019 at 14:53

2 Answers 2

2

This is a DNS problem. Your runner cannot resolve the hostname of the GitLab server - gitlab.teledirectgroup.com. Did you set the GitLab hostname if your local workstation's host file manually, or did you set it up in a DNS server as a 'proper' hostname?

If you set up the hostname in a DNS server then the solution may be as simple as adding the DNS server to /etc/resolv.conf on the runner. However, if you just set the GitLab hostname in your workstation's hosts file then you'll need to set it in the runner's /etc/hosts file, too. It's hard to say what the exact solution is without knowing how you set up the GitLab hostname in the first place.

Sign up to request clarification or add additional context in comments.

Comments

0

the solution that’s so applied to GitLab?

Use the git clone by ssh, I don’t have a good goal that’s so I can up to push that’s changes over a submodule from runner Shell by GitLab CI. The pipeline ever fails and prints this error. ERROR PIPELINE JOB

In the local repo as a project the file config contains that line with the URL, more don’t have login with this about the pipeline. .git/config

Some help or walkthrough of reference to culminate with that challenge in troubleshooting!

This is my code over the file ".gitlab-ci.yml"

variables:
    TEST_VAR: "Update Git Submoudel in all Etecnic projects."

job1:
    variables: {}
    script:
        - echo "$TEST_VAR"

job2:
    variables: {}
    script:
        - echo "OK" >> exito.txt
        - git add --all
        - git commit -m "Update Submodule"
        - git push origin HEAD:master

Versions:

GitLab:

gitlab-ce is already the newest version (15.6.0-ce.0).

Runner:

Version: 15.5.1

Git revision: 7178588d

Git branch: 15-5-stable

GO version: go1.18.7

Built: 2022-11-11T09:45:25+0000

OS/Arch: linux/amd64

Thanks so much for your attention.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.