Create Git repository

  1. Open your Gitlab dashboard.

    • Click the Projects on the left menu.
    • Click the New project button. GitRepoCreation
    • At Create new project page, choose Create blank project option. GitRepoCreation
    • At Create blank project page.
      • Enter fcaj-book-store-frontend at Project name.
      • Choose your namespace at Project URL.
      • Uncheck Initialize repository with a README. GitRepoCreation
      • Scroll down and click the Create project button. GitRepoCreation
    • The project fcaj-book-store-frontend is successfully created. GitRepoCreation
  2. Upload the source code to fcaj-book-store-frontend Gitlab project.

    • Go to the root directory of FCAJ_Workshop-Serverless project that you downloaded before.

    • Open src/config.js, change the value of APP_API_URL to the Invoke URL that you recorded in the Create SAM pipeline step. GitRepoCreation

    • Next, create a new file called buildspec.yml at the root directory of FCAJ_Workshop-Serverless project as the following code.

      version: 0.2
      
      phases:
        install:
          runtime-versions:
            nodejs: 20.9.0
          commands:
            - npm install -g yarn
        pre_build:
          commands:
            - echo Removing lock files...
            - rm -f package-lock.json
            - rm -f yarn.lock
        build:
          commands:
            - echo Build started on `date`
            - yarn install
            - yarn build
      
      artifacts:
        base-directory: build
        files:
          - "**/*"
        discard-paths: no
      

      GitRepoCreation

    • In the GitLab project page, click the HTTPS tab to get the repository URL. GitRepoCreation

    • Run the code below in your terminal at the root directory of FCAJ_Workshop-Serverless project.

      rm -rf .git
      git init
      git remote add origin https://gitlab.com/<your-username>/fcaj-book-store-frontend.git
      git add .
      git commit -m "Initial commit"
      

      GitRepoCreation GitRepoCreation

    • Push the code to the master branch.

      git push --set-upstream origin master
      

      GitRepoCreation

  3. Back to fcaj-book-store-frontend Gitlab project. You could see the code has been uploaded. GitRepoCreation