title: How to clone git repository with GitLab CI-CD or how to deploy spring-boot project on AWS server?
body: <p>I try to deploy the spring-boot project with GitLab CI/CD. But can't find any information that can help me.</p>
  <p>So, I try to figure out how I can do it and created an AWS instance and run the <code>gitlub-runner</code> on it.</p>
  <p>I created <code>.gitlab-ci.yml</code> and can copy files to the S3-bucket:</p>
  <pre><code>variables:
    S3_BUCKET_NAME: &quot;awesome-proj&quot;
  deploy:
    script: aws s3 cp ./ s3://awesome-proj/ --acl bucket-owner-full-control --no-sign-request --recursive --exclude &quot;*&quot; --include &quot;*.html&quot;
    tags:
      - Tag1
  </code></pre>
  <p>I figure out I can use the console in a similar way and clone my project to the AWS server. I decided to clone the project from the git repo and build him on the server with 'maven'.</p>
  <p>So I try to clone the project:</p>
  <pre><code>  S3_BUCKET_NAME: &quot;awesome-proj&quot;
  deploy:
    script: 
      - sudo cd /home/ec2-user/aweproject
      - sudo git init
      - sudo git clone https://gitlab.com/lTer/cicdtestdev.git
    tags:
      - Tag1
  </code></pre>
  <p>These scripts even copied some data once.</p>
  <p><a href="https://i.stack.imgur.com/qlGno.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qlGno.png" alt="enter image description here" /></a></p>
  <p>For the second time, I got the error, but it is doesn't matter now. The problem is that I haven't any files after <code>git clone...</code>. So it not works how I hoped.</p>
  <ul>
  <li>How to correctly use the console with <code>GitLab-runner</code> or deploy the project (spring-boot) with Gitlab ci/cd to the AWS?</li>
  </ul>