Skip to content

Commit

Permalink
Starting point
Browse files Browse the repository at this point in the history
Update README
  • Loading branch information
jelaniwoods committed Aug 4, 2021
0 parents commit 0211d3b
Show file tree
Hide file tree
Showing 95 changed files with 3,996 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
/.bundle

# Ignore the default SQLite database.
# /db/*.sqlite3
# /db/*.sqlite3-journal


# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore uploaded files in development.
/storage/*
!/storage/.keep

/public/assets
.byebug_history

# Ignore master key for decrypting credentials and more.
/config/master.key

/public/packs
/public/packs-test
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity

# Ignore dotenv files
/.env*

.rbenv-gemsets
examples.txt
whitelist.yml
grades.yml
cloud9_plugins.sh
appdev/
node_modules
package-lock.json
core.chrome*
!vendor/
.theia/.ltici_apitoken.yml
16 changes: 16 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
image: jelaniwoods/appdev2021-very-best-debug@sha256:ba0e76c9121412ee5366011b090740c21538c1c19ffc29929c66372d1eaa0984

tasks:
- command: bundle install
- init: bin/setup
ports:
- port: 3000
onOpen: open-preview
visibility: public

vscode:
extensions:
- shd101wyy.markdown-preview-enhanced
- wingrunr21.vscode-ruby
- mbessey.vscode-rufo
- aliariff.vscode-erb-beautify
8 changes: 8 additions & 0 deletions .pryrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Pry.config.print = proc do |output, value, _pry_|
case value
when ActiveRecord::Relation
output.puts "=> #{value.to_s}"
else
Pry::ColorPrinter.default(output, value, _pry_)
end
end
4 changes: 4 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
--color
--format documentation
--order default
--require spec_helper
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby-2.7.3
10 changes: 10 additions & 0 deletions .theia/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"editor.autoSave": "on",
"editor.tabSize": 2,
"emmet.includeLanguages": {
"erb": "html"
},
"files.associations": {
"*.erb": "erb"
}
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"editor.tabSize": 2,
"emmet.includeLanguages": {
"erb": "html"
},
"files.associations": {
"*.erb": "erb"
}
}
108 changes: 108 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
FROM buildpack-deps:focal

### base ###
RUN yes | unminimize \
&& apt-get install -yq \
zip \
unzip \
bash-completion \
build-essential \
htop \
jq \
less \
locales \
man-db \
nano \
software-properties-common \
sudo \
time \
vim \
multitail \
lsof \
&& locale-gen en_US.UTF-8 \
&& mkdir /var/lib/apt/dazzle-marks \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*

ENV LANG=en_US.UTF-8

### Git ###
RUN add-apt-repository -y ppa:git-core/ppa \
&& apt-get install -yq git \
&& rm -rf /var/lib/apt/lists/*

### Gitpod user ###
# '-l': see https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#user
RUN useradd -l -u 33333 -G sudo -md /home/gitpod -s /bin/bash -p gitpod gitpod \
# passwordless sudo for users in the 'sudo' group
&& sed -i.bkp -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers
ENV HOME=/home/gitpod
WORKDIR $HOME
# custom Bash prompt
RUN { echo && echo "PS1='\[\e]0;\u \w\a\]\[\033[01;32m\]\u\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\] \\\$ '" ; } >> .bashrc

### Gitpod user (2) ###
USER gitpod
# use sudo so that user does not get sudo usage info on (the first) login
RUN sudo echo "Running 'sudo' for Gitpod: success" && \
# create .bashrc.d folder and source it in the bashrc
mkdir /home/gitpod/.bashrc.d && \
(echo; echo "for i in \$(ls \$HOME/.bashrc.d/*); do source \$i; done"; echo) >> /home/gitpod/.bashrc

### Ruby ###
LABEL dazzle/layer=lang-ruby
LABEL dazzle/test=tests/lang-ruby.yaml
USER gitpod
RUN curl -sSL https://rvm.io/mpapis.asc | gpg --import - \
&& curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - \
&& curl -fsSL https://get.rvm.io | bash -s stable \
&& bash -lc " \
rvm requirements \
&& rvm install 2.7.3 \
&& rvm use 2.7.3 --default \
&& rvm rubygems current \
&& gem install bundler --no-document \
&& gem install solargraph --no-document" \
&& echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*' >> /home/gitpod/.bashrc.d/70-ruby
RUN echo "rvm_gems_path=/home/gitpod/.rvm" > ~/.rvmrc

USER gitpod
# AppDev stuff

WORKDIR /base-rails

# Install Google Chrome
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
RUN sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
RUN sudo apt-get -y update
RUN sudo apt-get -y install google-chrome-stable
# Install Chromedriver
RUN sudo apt-get -y install google-chrome-stable
RUN wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip
RUN unzip chromedriver_linux64.zip

RUN sudo mv chromedriver /usr/bin/chromedriver
RUN sudo chown root:root /usr/bin/chromedriver
RUN sudo chmod +x /usr/bin/chromedriver

RUN /bin/bash -l -c "gem install htmlbeautifier"
RUN /bin/bash -l -c "gem install rufo"
COPY Gemfile /base-rails/Gemfile
COPY --chown=gitpod:gitpod Gemfile.lock /base-rails/Gemfile.lock
RUN /bin/bash -l -c "gem install bundler:2.1.4"

USER gitpod

RUN /bin/bash -l -c "bundle install"

RUN /bin/bash -l -c "curl https://cli-assets.heroku.com/install.sh | sh"

RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

RUN sudo apt-get update && sudo apt-get install -y nodejs yarn
# postgresql-client
# RUN sudo apt-get update && sudo apt-get install -y yarn
RUN sudo apt install -y postgresql postgresql-contrib libpq-dev psmisc lsof expect
USER gitpod
RUN echo "rvm use 2.7.3" >> ~/.bashrc
RUN echo "rvm_silence_path_mismatch_check_flag=1" >> ~/.rvmrc
68 changes: 68 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.7.3'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.3', '>= 6.0.3.2'
# Use sqlite3 as the database for Active Record

# Use Puma as the app server
gem 'puma', '~> 4.1'
gem "faker"
# Use Active Model has_secure_password
gem 'bcrypt'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '~> 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end

gem 'rack-timeout', require: 'rack/timeout/base'
gem 'sprockets', '< 4'
gem 'sassc-rails'
gem 'execjs'
gem 'therubyracer', platforms: :ruby

group :development, :test do
gem 'amazing_print'
gem 'dotenv-rails'
gem 'grade_runner', github: 'firstdraft/grade_runner'
gem 'pry-rails'
gem 'sqlite3', '~> 1.4.1'
gem 'table_print'
gem 'web_git', github: 'firstdraft/web_git', branch: 'spring2020'
end

group :development do
gem 'annotate'
gem 'better_errors', '2.6'
gem 'binding_of_caller'
gem 'draft_generators', github: 'firstdraft/draft_generators', branch: 'winter-2020'
gem 'rails_db', '2.3.1'
end

group :test do
gem 'capybara'
gem 'factory_bot_rails'
gem 'rspec-rails'
gem 'webmock'
gem 'rspec-html-matchers'
gem 'selenium-webdriver'
end

group :production do
gem 'pg'
end
Loading

0 comments on commit 0211d3b

Please sign in to comment.