You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Purpose of this documentation 

Is to help systems administrators support and maintain the script for installing the OHIE stack: "How to install DATIM4U OHIE Stack"

General References

http://packaging.ubuntu.com/html/packaging-new-software.html

https://askubuntu.com/questions/164621/how-do-i-add-a-binary-file-to-my-existing-ppa-package

https://askubuntu.com/questions/146343/how-to-create-a-deb-package-that-installs-a-series-of-files

https://askubuntu.com/questions/33413/how-to-create-a-meta-package-that-automatically-installs-other-packages


 

Preliminary Requirements

  1. Add your `id_rsa.pub` ssh key to launchpad
    1. Navigate to https://launchpad.net/people/+me/+editsshkeys
    2. copy and paste your public key into the prompt
      1. to output your public key into the terminal run the following command:

        cat ~/.ssh/id_rsa.pub

 

Setup Vagrant

  1. References
    1. https://www.olindata.com/en/blog/2014/07/installing-vagrant-and-virtual-box-ubuntu-1404-lts
  2. Install packages

    sudo apt-get -y install virtualbox vagrant virtualbox-dkms
  3. Install a Vagrant Box

    1. Use hashicorp to find a suitable box to install, like ubuntu/trusty64 at https://atlas.hashicorp.com/ubuntu/boxes/trusty64
      1. note, rest of development we will assume that we are using the ubuntu/trusty64 box from hashicorp
    2. navigate to a directory where you wish to store your vagrant configurations for this setup
      1. e.g., 

        mkdir /var/www/vagrant/ && cd /var/www/vagrant/
    3. download and setup vagrant box: 

      vagrant init ubuntu/trusty64; vagrant up --provider virtualbox
  4. Create relevant provisions and vagrant settings  
    1. Open the Vagrantfile for your vagrant

      nano /var/www/vagrant/Vagrantfile
    2. Insert the following code into the Vagrant file, at the end - but before the `end` command

      1. Don't forget to replace the values for `your_launchpad_name`, `your_launchpad_email`, etc... 
      2.  This process will take a /while/ to run you provision your vagrant, especially the first time.

         config.ssh.forward_agent = true; config.vm.provision "shell" do |s| your_launchpad_name = "Launchpad Name"; your_launchpad_email = "launchpademail@provider.com"; your_launchpad_username = "launchpadusername"; your_gpg_password = "a_gpg_password"; your_git_email = "yourgitemail@provider.com"; your_git_username = "gitusername"; s.inline = <<-SHELL echo "##########################"; echo Beginning provisioning of packaging environment setup.; echo "##########################"; echo For launchpad: echo Using #{your_launchpad_name} as your name, echo Using #{your_launchpad_email} as your email, echo Using #{your_launchpad_username} as your username... echo For git: echo Using #{your_launchpad_email} as your email, echo Using #{your_launchpad_username} as your username... echo "##########################"; echo Updating and Upgrading echo "##########################"; sudo apt-get update && sudo apt-get -y upgrade; echo "##########################"; echo Installing package building packages...; echo "##########################"; sudo apt-get -y install gnupg pbuilder ubuntu-dev-tools bzr-builddeb apt-file; sudo apt-get -y install packaging-dev; # Install packaging package echo This next part may take a little while...; pbuilder-dist trusty create; echo "##########################"; echo Configuring Bazaar...; echo "##########################"; bzr whoami "#{your_launchpad_name} <#{your_launchpad_email}>"; bzr launchpad-login #{your_launchpad_username}; echo "##########################"; echo Configuring Git...; echo "##########################"; git config --global user.email "#{your_git_email}" git config --global user.name "#{your_git_username}" git config --global push.default simple echo "##########################"; echo Assigning your DEBFULLNAME and DEBEMAIL; echo "##########################"; echo $'export DEBFULLNAME="#{your_launchpad_name}"\nexport DEBEMAIL="#{your_launchpad_email}"' >> ~/.bashrc; source ~/.bashrc; echo "##########################"; echo Creating your vagrants GPG key; echo "##########################"; sudo apt-get install rng-tools; cat > .temp_settings_file <<-SETTINGS %echo Generating a basic OpenPGP key... Key-Type: RSA Key-Length: 2048 Subkey-Type: RSA Subkey-Length: 2048 Name-Real: #{your_launchpad_name} Name-Email: #{your_launchpad_email} Expire-Date: 0 Passphrase: #{your_gpg_password} %commit %echo OpenPGP key created successfully. SETTINGS gpg --batch --gen-key .temp_settings_file; rm .temp_settings_file; echo "##########################"; echo Packaging environment successfuly provisioned [Success]. SHELL end
    3. Note: if you had run vagrant up before setting these provisions you will need to run vagrant reload --provision to see these changes affect your vagrant.

 

 

Congradulations

You're all done.

config.ssh.forward_agent = true;              config.vm.provision "shell" do |s|                your_launchpad_name = "Launchpad Name";                your_launchpad_email = "launchpademail@provider.com";                your_launchpad_username = "launchpadusername";                your_gpg_password = "a_gpg_password";                your_git_email = "yourgitemail@provider.com";                your_git_username = "gitusername";                s.inline = <<-SHELL                    echo "##########################";                    echo Beginning provisioning of packaging environment setup.;                    echo "##########################";                    echo For launchpad:                    echo Using #{your_launchpad_name} as  your name,                    echo Using #{your_launchpad_email} as your email,                    echo Using #{your_launchpad_username} as your username...                    echo For git:                    echo Using #{your_launchpad_email} as your email,                    echo Using #{your_launchpad_username} as your username...
                    echo "##########################";                    echo Updating and Upgrading                    echo "##########################";                    sudo apt-get update && sudo apt-get -y upgrade;
                    echo "##########################";                    echo Installing package building packages...;                    echo "##########################";                    sudo apt-get -y install gnupg pbuilder ubuntu-dev-tools bzr-builddeb apt-file;                     sudo apt-get -y install packaging-dev; # Install packaging package                    echo This next part may take a little while...;                    pbuilder-dist trusty create;
                    echo "##########################";                    echo Configuring Bazaar...;                    echo "##########################";                    bzr whoami "#{your_launchpad_name} <#{your_launchpad_email}>";                    bzr launchpad-login #{your_launchpad_username};
                    echo "##########################";                    echo Configuring Git...;                    echo "##########################";                    git config --global user.email "#{your_git_email}"                    git config --global user.name "#{your_git_username}"                    git config --global push.default simple
                    echo "##########################";                    echo Assigning your DEBFULLNAME and DEBEMAIL;                    echo "##########################";                    echo $'export DEBFULLNAME="#{your_launchpad_name}"\nexport DEBEMAIL="#{your_launchpad_email}"' >> ~/.bashrc;                    source ~/.bashrc;
                    echo "##########################";                    echo Creating your vagrants GPG key;                    echo "##########################";                    sudo apt-get install rng-tools;                    cat > .temp_settings_file <<-SETTINGS                      %echo Generating a basic OpenPGP key...                      Key-Type: RSA                      Key-Length: 2048                      Subkey-Type: RSA                      Subkey-Length: 2048                      Name-Real: #{your_launchpad_name}                      Name-Email: #{your_launchpad_email}                      Expire-Date: 0                      Passphrase: #{your_gpg_password}                      %commit                      %echo OpenPGP key created successfully.          SETTINGS                    gpg --batch --gen-key .temp_settings_file;                    rm .temp_settings_file;
                    echo "##########################";                    echo Packaging environment successfuly provisioned [Success].                SHELL              end

  • No labels