docker-credential-pass Ubuntu setup for Bamboo CI/CD

Standard

Ubuntu: 18.04
Docker: 18.09.5
docker-credential-pass: 0.6.2
pass: 1.7.1
gpg2: 2.2.4

Since my setup is for CI/CD I have a bamboo user to deploy my docker containers to Docker Hub and deploy to my production servers. Your use case may vary, but if you want your credentials to persist longer than a couple of hours before your system starts asking you to re-enter your passphrase this might work for you.

My gpg-agent.conf file looks like this:

This worked for me. Also note the default-cache-ttl value is in seconds, the values I used is 10 years in seconds.

Getting SimpleCov-summary (0.0.5) to work with SimpleCov (0.16.1) and Rails 5.2

Standard

If you run into issues with installing simplecov-summary using:

Here’s how to fix it:

Since Rails 5 removed silence_stream because it is not thread-safe. I found implementations of silence_stream but I got it to work by just removing it completely and I prefer to see these outputs at the end of my test run.

Rails 5.2 Has And Belongs To Many with UUID

Standard

When using UUIDs and you are creating a join table like so:

You will get a migration file like so:

You’ll need to modify it accordingly:

Then run:

And you should be good. Just remember if you are using UUIDs you might want to make sure all models you generate use UUIDs.

In config/application.rb:

And make sure your generated migrations have:

Enjoy!

Installing Jira Software Server

Standard

Assuming you have downloaded from Atlassian. If not read how to prepare for installs.

Follow prompts and make sure you enable the service option if you want Jira Software to autostart on bootup.

If you installed using sudo it’ll place the app in dir: /opt/atlassian/jira, which is good.

Note these files in case you don’t want it to be installed as a service or if something happens.

Preparing a Server for Atlassian Software

Standard

I’ve been a user of Jira before the kanban “agile” interface and it was still one suite with an agile plugin. I use both Jira Core (“task”) and Jira Software (“agile”). I use Core for task based projects and Software for well software based projects.

I actually use Core for home projects like: my daughters 3rd birthday, remodeling the garage, gardening task like cloning my chili plant or gardenias. I have a project with multiple task and sub-task.

Given: I have an over powered media server running Ubuntu 18.04 and I have a need to track my personal task and projects. And I thought it would be a fun weekend project.

When: I install Atlassian’s Jira Software Server, Jira Core Server, and Confluence Server (I will be also installing Bamboo Server and BitBucket Server at a later time)

Then: I will have access to Jira for any task or project and I can track progress. I will have also learned how to manage and use Jira from another point of view. Not just moving features across and completing them.

Continue reading

Updating Ubuntu 17.10 to 18.04

Standard

If you need to upgrade your Ubuntu to a new release.

Wait a few minutes/hours, you should have upgraded your server.

New Rails Project On Clean System

Standard

Creating a new Rails project on a clean system.

Install iTerm2. *My terminal of choice.

Install Xcode and command line tools.

Install Homebrew.

Install OhMyZSH. *My preferred shell.

Install rvm or rbenv or docker.

I prefer to use rvm on my development system and/or docker, I moved over from vagrant and vmware fusion. I prefer rvm on my dev system over rbenv. But I prefer rbenv over rvm on production servers if i’m not using docker.

Using MyNewProject as the project name.

1. Create the working directory.

2. Create the Rails app.

3. Done

Use your favorite text editor. Mine is Sublime and Vi.

Development Environment with Rails

Standard

Currently, I favor development with Docker because of the ease of deployment. I see the benefits when in a team environment using Docker, onboarding is much easier. Similar to using virtual machines you have images with your development environment all set up but with docker (containers) the footprints are somewhat smaller. I say that because the standard ruby base image isn’t exactly a lightweight it’s still around 700MB+ in size. But you could use Alpine Linux base images for the surrounding services ie database, Redis, elastic search.

I have experienced a few development environments so I’ll go through and list my point of view. Note: nothing here is the absolute best or de facto, just what I’ve used in real-world development teams. 

Continue reading

Creating an image with A Dockerfile

Standard

The Dockerfile

Simply a file or manifest that has all the commands needed to be run to create an image when you run ‘docker build’. You can find more information here: Dockerfile docs

Simple Dockerfile

Just to keep it simple a Dockerfile can be as simple as installing packages after setting up a server and creating some directories. Here’s an example:

Here is a Dockerfile I used for a virtual host apache image:
https://github.com/mfung/alpine_apache2_php7

Commands

Some commands when dealing with building an image:

 

Using Docker-compose

Standard

Commands for docker-compose

You will need a YAML file that contains your stack.

Stack file

A little more complex example: https://gist.github.com/mfung/9b0fd65ccc793c7b1ec44dfb2deb370d