netlify에 감동했기 때문에 netlify-cli를 사용해 보았습니다.

4674 단어 netlify-cliNetlifyMac

소개



netlify란?

Netlify는 정적 콘텐츠를 초고속으로 제공하는 웹 서비스입니다.

netlify의 특징


  • 빌드, 배포를 자동으로 해준다
  • 완전 무료 SSL/HTTPS
    무료 테두리에서도 사용할 수 있으며 자체 도메인도 설정할 수 있습니다
  • GitHub, GitLab, Bitbucket 계정으로 로그인 할 수 있습니다

  • 이 책에 대하여



    이 문서에서는 netlify-cli를 사용하여 로컬 파일을 배포하고 동작 확인까지 수행합니다.

    netlify에 로그인하여 정적 콘텐츠를 배포하는 경우 아래를 참고로 받을 수 있다고 생각합니다.

    htps : // c 롯 s-벤 ch. 이 m/bぉg/데시 겐/1454/
    h tp // 도지 고양이. 는 bぉ. jp/엔트리/2017/09/17/205259

    여기에서 본제



    먼저 npm에서 netlify-cli를 설치합니다.
    $ npm install -g netlify-cli
    

    netlify와 두드려보세요
    $ netlify
    
    ⬥ Netlify CLI
    Read the docs: https://www.netlify.com/docs/cli
    Support and bugs: https://github.com/netlify/cli/issues
    
    Netlify command line tool
    
    VERSION
      netlify-cli/2.2.1 darwin-x64 node-v10.2.1
    
    USAGE
      $ netlify [COMMAND]
    
    COMMANDS
      deploy  Create a new deploy from the contents of a folder
      init    Configure continuous deployment for a new or existing site
      link    Link a local repo or project folder to an existing site on Netlify
      login   Login to your Netlify account
      open    Open settings for the site linked to the current folder
      sites   Handle various site operations
      status  Print status information
      unlink  Unlink a local folder from a Netlify site
      watch   Watch for site deploy to finish
    

    버전 확인
    $ netlify -v
    netlify-cli/2.2.1 darwin-x64 node-v10.2.1
    

    프로젝트 만들기
    $ netlify init
    
    No git remote found. (╯°□°)╯︵ ┻━┻
    
    It is recommended that you initialize a site that has a remote repository in Github.
    
    This will allow for Netlify Continuous deployment to build branch & PR previews.
    
    For more details on Netlify CI checkout the docs: http://bit.ly/2N0Jhy5
    
    Unable to find a remote origin url. Please add a git remote.
    
    git remote add origin https://github.com/YourUserName/RepoName.git
    
    ? Do you want to create a netlify site without a git repository? Yes, create manually deploy site
    Choose a site name or leave blank for a random name. You can update later.
    ? Site name (optional): simple-sample-site
    ? Account: mollgula  (personal)
    
    Site Created
    
    Admin URL: https://app.netlify.com/sites/simple-sample-site
    URL:       https://simple-sample-site.netlify.com
    Site ID:   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    
    "simple-sample-site" site was created
    
    To deploy to this site. Run your site build and then netlify deploy
    
    

    URL : h tps : // / mp ぇ- mp ぇ-하고. 네 tぃfy. 이 m
    만든 위의 URL에는 액세스할 수 없지만 배포 시 표시되는 URL에는 액세스할 수 있습니다.

    배포할 폴더 만들기
    $ mkdir sample
    $ cd sample
    $ touch index.html
    $ vim index.html
    

    index.html의 내용은 이쪽
    <!DOCTYPE html>
    <html lang="ja">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>My-homepage</title>
    </head>
    <body>
        <h1>My-simple-site</h1>
    </body>
    </html>
    

    배포해보기
    $ netlify deploy
    Please provide a deploy path relative to:
    /Users/XXXXXX/Desktop
    ? deploy path /Users/XXXXXX/Desktop/sample
    Deploy path: /Users/XXXXXX/Desktop/sample
    Deploying to draft URL...
    ✔ Finished hashing 1 files
    ✔ CDN requesting 1 files
    ✔ Finished uploading 1 assets
    ✔ Draft deploy is live!
    
    Logs:           https://app.netlify.com/sites/simple-sample-site/deploys/XXXXXXXXXXXXXXXXXXX
    Live Draft URL: https://XXXXXXXXXXXXXXXXXXX--simple-sample-site.netlify.com
    
    If everything looks good on your draft URL, take it live with the --prod flag.
    netlify deploy --prod
    

    접근하다
    Live Draft URL: https://XXXXXXXXXXXXXXXXXXX--simple-sample-site.netlify.com
    

    배포할 수 있었다! !


    이상입니다.
    여기까지 읽어 주셔서 감사합니다.

    좋은 웹페이지 즐겨찾기