ualbertalib / Developer-Handbook

Single source of documentation for the University of Alberta Libraries developers common tools and practices
29 stars 2 forks source link

Developer-Handbook

Single source of documentation for the University of Alberta Libraries developers common tools and practices

Version Control

Version control is important to our operation

Github https://github.com/ualbertalib
Ops managed Github https://code.library.ualberta.ca/gitweb/ -- requires Network login / Windows credentials

SSH Keys

The Secure Shell (SSH) Protocol is a protocol for secure remote login and other secure network services over an insecure network. [The Secure Shell (SSH) Protocol Architecture]

The recommended way to authenticate and communicate over ssh is through public/private key pairs. You share your public key with a server and it is stored in .ssh/authorized_keys. Keep your private key secret and on your desktop machine (in your ~/.ssh/ directory).

These keys can be created with Linux command-line tools. In a Windows environment, they can be created using the equivalent tools in [Cygwin]. If you have already created a key pair with PuttyGen and shared it with the sysadmins, you can convert it to the necessary OpenSSH-style keys by following these instructions.

To create your keys:

ssh-keygen -t rsa

They are located

ls ~/.ssh
id_rsa id_rsa.pub

To use these as credentials:

  1. share your public key (id_rsa.pub) with your friendly neighborhood systems administrator

  2. before attempting to login for the first time in a session, you must start the ssh agent and add your key (hint add this to your bash profile):

    eval `ssh-agent -s`
    ssh-add
  3. to see which keys are currently loaded

    ssh-add -l

In Windows you can [use Pageant] to load your key for use by Putty.

DevOps

DevOps means different things to different people. To us it means Developers and Operations working together (Dev+Ops=DevOps) towards the same goal of putting quality applications in production as efficiently and painlessly as possible.

Dev/Test/Production

Once an application is 'working' it is deployed in dev, test, and prod environments. This facilitates the hand off between the Developer and Operations, by giving the Developer a production-like environment to build in, a test environment for developers and Operations to collaborate and practice on, and a production environment that is a known quantity to Operations because it's been proven.

Development Environment

User Acceptance Testing (UAT) Environment

Production Environments

When a bug or feature is identified which requires a change.

  1. Identify which component(s) are affected.
  2. Write test which identifies bug.
  3. Write code which fixes bug.
  4. Tests pass.
  5. Update documentation
  6. Commit to version control. (Everything is in version control!)
  7. Build component
    • this varies depending on component affected
    • ks requires rebuild of server
    • package requires rebuild of package
    • last mile script/recipe doesn't really require this step
  8. Deploy/update component in 'test' environment
  9. Tests pass
  10. Change request for anything big (in accordance with ITIL principles)
  11. Deploy/update component in 'prod' environment