Skip to content

Push codebase changes to production

Rasmus Rudling edited this page Feb 21, 2022 · 3 revisions

First time

Get access to the Bornholm server

  1. Make sure the SSH Client is installed:

    1. Open the Settings panel, then click Apps.
    2. Under the Apps and Features heading, click Optional Features.
    3. Scroll down the list to see if OpenSSH Client is listed.

    If it’s not:

    1. Click the plus-sign next to Add a feature.
    2. Scroll through the list to find and select OpenSSH Client.
    3. Click Install.
  2. Open Command Prompt

    1. Press the Windows key.
    2. Type cmd.
    3. Under Best Match, right-click Command Prompt.
    4. Click Run as Administrator.
    5. If prompted, click Yes in the Do you want to allow this app to make changes to your device? pop-up.
  3. Use OpenSSH to Generate an SSH Key Pair.

    1. In the command prompt, type ssh-keygen.
    2. By default, the system will save the keys to C:\Users\<your-username>/.ssh/id_rsa. You can use the default name, or you can choose more descriptive names. This can help distinguish between keys if you are using multiple key pairs. To stick to the default option, press Enter.
    3. You’ll be asked to enter a passphrase. Hit Enter to skip this step.
    4. The system will generate the key pair, and display the key fingerprint and a randomart image.
    5. Open your file browser.
    6. Navigate to C:\Users\<your-username>/.ssh.
    7. You should see at least two files. The identification is saved in the id_rsa file and the public key is labeled id_rsa.pub. This is your SSH key pair.
  4. Copy your RSA key.

    1. Navigate to C:\Users\<your-username>/.ssh.
    2. clip < ~/.ssh/id_rsa.pub: copies the key to your clipboard.
    3. Send the copied key to a computer having access to the server already (a previous Head of Internal System for example).
  5. Add the key to the server (this step needs to be performed by a computer already having access to the server).

    1. Sign in to the server via ssh: ssh armada@bornholm.sys.armada.nu.
    2. sudo -i: goes into admin mode.
      It increadably important that you use ">>" and not ">" below since using ">" would override the files. If you want to be on the safe side you can manually append the copied key into the files below using vim.
    3. echo -n "<the-key-copied-in-step-4>\n" >> /usr/home/ais/.ssh/authorized_keys
    4. echo -n "<the-key-copied-in-step-4>\n" >> /usr/home/armada/.ssh/authorized_keys
    5. echo -n "<the-key-copied-in-step-4>\n" >> /usr/home/maps/.ssh/authorized_keys
    6. echo -n "<the-key-copied-in-step-4>\n" >> /usr/home/wiki/.ssh/authorized_keys

For everyone

git remote add ais ais@bornholm.sys.armada.nu:/usr/home/ais/git: add the ais production remote.

All times

  1. Make sure you're in the root directory in the ais repository.
  2. git checkout master: switch to the master branch.
  3. git pull: pull down the latest changes from the GitHub repository.
  4. git push ais: Pushes the new changes to production.
Clone this wiki locally