0

I've setup own gitlab server on AWS EC2 Instance based on this image - https://aws.amazon.com/marketplace/pp/prodview-w6ykryurkesjq?ref_=aws-mp-console-subscription-detail and assign Elastic IP for this instance.

I've prepared some pipeline for repository and getting error (after push and check pipeline status):

Running with gitlab-runner 14.3.2 (e0218c92)
  on [PRIVATE IP ADDRESS] JA-qzGJG
Preparing the "docker" executor
Using Docker executor with image node:latest ...
Pulling docker image node:latest ...
Using docker image sha256:c4fbd63932640bbb14c76f80c5b53daf8f01cc1f011d260d07f35bb6874c0c30 for node:latest with digest node@sha256:fec9ab31c9d46ad952abed8119b71e01e995975bd7b580f07b249e803d306dbe ...
Preparing environment
00:02
Running on [RUNNER_NAME] via [PRIVATE IP ADDRESS]...
Getting source from Git repository
02:11
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /builds/logifiles/queue/.git/
fatal: unable to access 'http://ec2-[OLD_EC2_INSTANCE_IP_ADDRESS].compute-1.amazonaws.com/logifiles/queue.git/': Failed to connect to ec2-[OLD_EC2_INSTANCE_IP_ADDRESS].compute-1.amazonaws.com port 80 after 129988 ms: Operation timed out
ERROR: Job failed: exit code 1

I remove IP addreses, due security reasons. My pipelines for repository:

image: node:latest
cache:
  paths:
    - node_modules/
stages:
  - dist
before_script:
  - npm i
dist:
  stage: dist
  script:
    - echo "//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}">.npmrc
    - npm publish
  rules:
    - if: $CI_COMMIT_BRANCH == "master"

So how should i properly handle it ? How to change IP address in pipeline or set different url for gitlab, or maybe prepare some redirect from old ec2 instance domain to new one (from Elastic IP). Is there any other way how can i handle it ?

Edit 1

This is security group for inbound rules for ec2 instance: enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.