Skip to content

Commit

Permalink
Starting point
Browse files Browse the repository at this point in the history
  • Loading branch information
jelaniwoods committed Jun 14, 2022
0 parents commit fbaa0de
Show file tree
Hide file tree
Showing 84 changed files with 4,166 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 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
/db/*.sqlite3-*

# 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

# Ignore dotenv files
/.env*

.rbenv-gemsets
examples.txt
whitelist.yml
grades.yml
cloud9_plugins.sh
appdev/
node_modules
package-lock.json

core.chrome*

.theia/.ltici_apitoken.yml
.vscode/.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/appdev2022-rps-html

tasks:
- init: bin/setup
ports:
- port: 3000
onOpen: open-preview
- port: 9500-9999
onOpen: ignore


vscode:
extensions:
- vortizhe.simple-ruby-erb
- 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
47 changes: 47 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"editor.tabSize": 2,
"editor.acceptSuggestionOnEnter": "off",
"editor.bracketPairColorization.enabled": false,
"editor.cursorSurroundingLines": 8,
"editor.dragAndDrop": false,
"editor.guides.bracketPairs": true,
"editor.linkedEditing": true,
"editor.minimap.enabled": false,
"editor.smoothScrolling": false,
"editor.wordBasedSuggestionsMode": "allDocuments",
"editor.wordWrap": "on",
"editor.wrappingIndent": "deepIndent",
"workbench.editor.closeOnFileDelete": true,
"workbench.fontAliasing": "auto",
"workbench.startupEditor": "none",
"workbench.tree.renderIndentGuides": "always",
"files.autoSaveDelay": 500,
"files.exclude": {
"**/.git": true,
".vscode": true,
".bundle": true,
},
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"screencastMode.onlyKeyboardShortcuts": true,
"screencastMode.verticalOffset": 10,
"explorer.compactFolders": false,
"explorer.incrementalNaming": "smart",
"html.format.endWithNewline": true,
"html.format.preserveNewLines": true,
"html.format.templating": true,
"terminal.integrated.altClickMovesCursor": true,
"[erb]": {
"editor.formatOnSave": true
},
"[ruby]": {
"editor.formatOnSave": true
},
"vscode-erb-beautify.keepBlankLines": 1,
"ruby.intellisense": false,
"gitpod.openInStable.neverPrompt": true,
"redhat.telemetry.enabled": false,
"emmet.includeLanguages": {
"erb": "html"
},
}
106 changes: 106 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
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

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
66 changes: 66 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.7.3'

gem 'rails', '~> 6.0.3.2'

# Use Puma as the app server
gem 'puma', '~> 4.1'

# Use Active Model has_secure_password
gem 'bcrypt'


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
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

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'
gem 'binding_of_caller'
gem 'draft_generators', github: 'firstdraft/draft_generators', branch: 'winter-2020'
gem 'rufo'
gem 'htmlbeautifier'
end

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

group :production do
gem 'pg'
end
Loading

0 comments on commit fbaa0de

Please sign in to comment.