Skip to content

Commit

Permalink
Merge pull request #7 from delano/0.9-RC1
Browse files Browse the repository at this point in the history
[0.9-rc1] First release candidate for 0.9, at long last
  • Loading branch information
delano committed Jul 3, 2021
2 parents c2bca6e + c54e092 commit 388c520
Show file tree
Hide file tree
Showing 18 changed files with 761 additions and 445 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
@@ -0,0 +1,2 @@
Gemfile.lock

2 changes: 2 additions & 0 deletions .gemrc
@@ -0,0 +1,2 @@
gem: --no-rdoc --no-ri

73 changes: 73 additions & 0 deletions .gitconfig
@@ -0,0 +1,73 @@
# This is Git's per-user configuration file.
[core]
user = delano
email = delano@solutious.com
ignorecase = false
pager = less -r

[color]
ui = true
diff = always
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan

[alias]
st = status
ci = commit
br = branch
co = checkout
df = diff
lg = log -p
sig = log --show-signature
brd = branch --sort=-committerdate
# MIT License
#
# Copyright (c) [2017] [Libin Varghese]
stash-search = "!f() { git show $(git stash list | cut -d\":\" -f 1) | grep \"$@\" ; }; f"

[user]
name = delano
email = delano@solutious.com
signingkey = AE63BC489CC3BC2E
[push]
default = matching
[init]
templatedir = ~/.git-templates

[branch "master"]
remote = origin
merge = refs/heads/master


[commit]
gpgsign = true
[gpg]
program = /usr/local/bin/gpg

[diff]
tool = diffmerge
submodule = log
[difftool "diffmerge"]
cmd = /usr/local/bin/diffmerge \"$LOCAL\" \"$REMOTE\"
[merge]
tool = diffmerge
[mergetool "diffmerge"]
cmd = diffmerge --merge --result=$MERGED $LOCAL $BASE $REMOTE
trustExitCode = true

[pager]
branch = false
tag = false
[status]
submodulesummary = true
7 changes: 7 additions & 0 deletions .gitignore
@@ -0,0 +1,7 @@
data/
pkg/
tmp/

*.log
.ruby-version

168 changes: 0 additions & 168 deletions CHANGES.txt

This file was deleted.

97 changes: 97 additions & 0 deletions Dockerfile
@@ -0,0 +1,97 @@
# syntax=docker/dockerfile:experimental

##
# A container for running the tryouts
#
# Usage:
#
# $ bin/tryouts
#
# OR
#
# $ export NAME=tryouts RUN_HOME=/run/host-services
# $ docker build -t $NAME .
# $ docker run -d --name $NAME -it --volume ${PWD}:/code --rm -v $RUN_HOME/ssh-auth.sock:$RUN_HOME/ssh-auth.sock -e SSH_AUTH_SOCK="$RUN_HOME/ssh-auth.sock" $NAME
# $ dssh $NAME
# $ docker stop $NAME
#

#
ARG VERSION=2.7.2

# FROM ruby:2.4.2-slim
FROM ruby:$VERSION

# The home directory for the application in the container
ARG CODE_ROOT=/code
ARG OWNER=coach
ARG SHELL=/bin/bash
ARG HOME=/home/$OWNER

# Change to 1 to exepct a Gemfile.lock
ARG BUNDLER_FROZEN=0

ARG PACKAGES="build-essential ruby-dev openssh-client screen git"

# Create the most dedicated user
RUN adduser --disabled-password --home $HOME --shell $SHELL $OWNER

# Get the latest package list (but skip upgrading for speed)
RUN set -eux && apt-get update -y

# Install the system dependencies
RUN apt-get install -y $PACKAGES

# This path is mounted in bin/tryouts
WORKDIR $HOME

# RUN gem install bundler
RUN gem install bundler -v '1.17.3'

# For <= 2.2
RUN gem update --system 2

ENV BUNDLE_SILENCE_ROOT_WARNING=1
RUN mkdir -p /usr/local/bundle && chown -R $OWNER /usr/local/bundle
RUN mkdir -p .bundle .gem && chown -R $OWNER .bundle $HOME/.gem
RUN bundle config --global frozen $BUNDLER_FROZEN

##
# Gear down into regular user world
#
# This change effects RUN, CMD, ENTRYPOINT
# but not COPY, ADD which take --chown argument instead
USER $OWNER

##
# Install rbenv with build capability
#
RUN git clone git://github.com/sstephenson/rbenv.git .rbenv
RUN git clone git://github.com/sstephenson/ruby-build.git .rbenv/plugins/ruby-build

ENV PATH=$HOME/.rbenv/shims:$HOME/.rbenv/bin:$HOME/.rbenv/plugins/ruby-build/bin:$PATH
# ARG PATH=$PATH

RUN echo "$VERSION" >> .ruby-version

RUN rbenv install --version $VERSION \
&& rbenv rehash \
&& rbenv shims

#
#RUN $SHELL -c "if [ '${VERSION}' == *'1.9'* ]; then echo 'RUBY1'; else echo 'RUBY2'; fi"

# This path is mounted in bin/tryouts
WORKDIR $CODE_ROOT

# Get. Ready. to Buuuuundllllle
COPY ./Gemfile $CODE_ROOT/

## Ruby 2.4+
# RUN bundle install -j4 --retry 3

# Ruby 1.9.3
RUN bundle install

ENV SHELL=$SHELL
CMD $SHELL
23 changes: 23 additions & 0 deletions Gemfile
@@ -0,0 +1,23 @@
# frozen_string_literal: false

# see: https://makandracards.com/makandra/478981-ruby-using-the-pry-debugger-in-projects-with-older-ruby-versions

source "https://rubygems.org"

git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

gem 'bundler'
gem 'rubygems-update'

## ruby 2.4, rubygems 2
# gem 'rubygems-update', '3.2.21'
# gem 'pry'

# ruby 1.9.
#https://stackoverflow.com/questions/11672201/unable-to-debug-in-rubymine-4-5-using-ruby-1-9-3
# gem 'debugger', '=1.1.4' # OR: gem install debugger -v 1.1.4

# gem 'pry-debugger', '=0.2.0'
gem 'pry', '=0.9.9'

gem 'tryouts'

0 comments on commit 388c520

Please sign in to comment.