Ali Elkhateeb
Ali Elkhateeb

Reputation: 3703

gitlab-ci.yml fatal: unable to access http://gitlab-ci-token

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

Upvotes: 0

Views: 1402

Answers (2)

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.

Upvotes: 0

Drew Blessing
Drew Blessing

Reputation: 2705

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.

Upvotes: 2

Related Questions