Giter Club home page Giter Club logo

lp-practice-static's Introduction

概要

レベルアッププログラミングの静的サイト公開の練習リポジトリです。

プロジェクト管理

このリポジトリのタスクはプロジェクトにて管理されています。 タスクの追加・進行・完了時は、プロジェクトの更新も忘れないようにしてください。

https://github.com/yos10/lp-practice-static/projects/1

サイトの URL

https://yos10.shop/

必要な情報

「XREA.COM NEW SIGNUP」というメールに書かれています。

ssh 接続

公開鍵認証で SSH 接続できるようになりました。

ssh [email protected] -i ~/.ssh/id_rsa_github

もし家のルータ再起動などでグローバル IP アドレスが変わった場合は、以下のコントロールパネルより、もう一度許可し直してください。
https://cp.xrea.com/site/tools/

リリース手順

プロジェクトディレクトリで以下のコマンドを実行してください

sh deploy.sh

Windows 11 でコンテナ内で rsync コマンドを使う

参考にしたページ
https://code.visualstudio.com/docs/remote/containers#_sharing-git-credentials-with-your-container

vscode に Remote - Containers 拡張機能をインストール
https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers

  1. powershell を管理者として実行し、以下のコマンドを入力して ssh-agent をスタートします。

    Set-Service ssh-agent -StartupType Automatic
    Start-Service ssh-agent
    Get-Service ssh-agent
    
  2. キーを ssh-agent に登録します。

    ssh-add $HOME/.ssh/id_rsa
    

    もしくは授業動画の 00:36:47 辺りを参考に ssh-keygen でファイル名を指定した場合

    ssh-add $HOME/.ssh/指定したファイル名
    
  3. 登録されたか確認します。

    ssh-add -L
    
  4. devcontainer 用のファイルを追加します。

  5. vscode の左下の >< をクリックし、Reopen in Container をクリックします。

  6. vscode server のインストールと、コンテナが起動するまでしばらく待ちます。

  7. vscode のターミナルを表示します。Ctrl + j でターミナルの表示/非表示ができます。

  8. グローバル IP を許可してから SSH 接続するには、以下のコマンドを実行します。

    ssh [ユーザ名]@[サーバのアドレス]
    
  9. ファイルを同期するには、以下のコマンドを実行します。

    sh deploy.sh
    
  10. コンテナを終了するには、vscode の左下の >< をクリックし、Reopen Folder Locally をクリックします。

  11. コンテナを削除するには、vscode の上部のメニューの ターミナル > 新しいターミナルをクリックし、以下のコマンドを実行します。

    docker-compose down
    

ssh-agent の設定を元に戻すには

  1. ssh-agent に登録したキーを削除するには、以下のコマンドを実行します。

    ssh-agent -D
    
  2. 削除されたか確認します。

    ssh-add -L
    
  3. ssh-agent を停止するには、powershell を管理者として実行し、以下のコマンドを入力します。

    Stop-Service ssh-agent
    
  4. ssh-agent のスタートアップの種類を無効にするには、powershell を管理者として実行し、以下のコマンドを入力します。

    Set-Service ssh-agent -StartupType Disabled
    

Tips: 秘密鍵をクリップボードへコピーするコマンド

cat ~/.ssh/id_rsa | clip

lp-practice-static's People

Contributors

yos10 avatar

Watchers

 avatar

lp-practice-static's Issues

WSL の Ubuntu で rsync を使う

WSL の Ubuntu で rsync を使う

VS Code に拡張機能の Remote WSL をインストール

https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl

Ubuntu のインストール

スタート > Microsoft Store > ubuntu で検索

インストールが終わったらユーザー名とパスワードを設定(両方とも ubuntu とか適当で OK)

アップデート

sudo apt update
sudo apt upgrade

wsl --install のコマンドで環境構築したなど、すでにインストール済みな場合はコンソールを表示します。
スタート > Ubuntu on Windows

Git の設定

SSH の設定
Git と GitHub の連携

Git の初期設定
Git に自分の情報を登録しよう

コードのクローン

mkdir ~/workspace
cd ~/workspace

いつも通りクローンして cd

git clone [email protected]:GitHubのユーザー名/lp-practice-static.git
cd lp-practice-static/

レンタルサーバに SSH 接続できるようにする

コマンドでサーバにファイルアップロードを参照

VS Code で開く

code .

VS Code Server がインストールされるのでしばらく待ちます。

Ctrl + j でターミナルの表示/非表示ができるので、コマンドの入力はこちらでもできます。

あとは教材通りで

コマンドでのサーバリリース自動化
https://www.nnn.ed.nico/contents/guides/5757

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.