Skip to content

Commit

Permalink
more prep for Rails 6
Browse files Browse the repository at this point in the history
  • Loading branch information
rubys committed Mar 15, 2019
1 parent 006adc8 commit 58b0ee2
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 9 deletions.
2 changes: 2 additions & 0 deletions dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ book:
- '4':
web: AWDwR4
env:
- rails: '6.0'
ruby: '2.6.1'
- rails: '5.2'
ruby: '2.4.1'
- rails: '5.1'
Expand Down
1 change: 1 addition & 0 deletions environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def self.dependencies(rails, ruby)
end

# grab app dependencies
template += '.tt' if not File.exist? template
if File.exist? template
gemfile = File.read(template)
if File.exist? base # Rails 3.1
Expand Down
2 changes: 2 additions & 0 deletions setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
nodejs: 'nodejs'
}

prereq[mysql].sub(/\s*mysql-server/, '') if File.exist? '/.dockerenv'

# accept node as an alias for nodejs; not absolutely required on Mac OS/X
prereqs.delete :nodejs unless `which node`.empty?
prereqs.delete :nodejs if RUBY_PLATFORM.include? 'darwin'
Expand Down
2 changes: 1 addition & 1 deletion setup/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN apt-get update -y && \
locale-gen $LANG

RUN apt-get install -y \
git \
git vim ruby \
libgmp3-dev \
libmysqlclient-dev \
libpq-dev \
Expand Down
24 changes: 22 additions & 2 deletions setup/Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace :mysql do
task :setup do
next if `docker container ls`.include? 'awdwr-mysql'
next if `docker container ls -a`.include? 'awdwr-mysql'
sh "docker run --network host --name awdwr-mysql " +
"-e MYSQL_ROOT_PASSWORD=root -d mysql/mysql-server"

Expand All @@ -23,7 +23,7 @@ namespace :mysql do
end
end

task :clobber do
task :clobber => :stop do
next unless `docker container ls`.include? 'awdwr-mysql'
system "docker stop awdwr-mysql"
system "docker container rm awdwr-mysql"
Expand All @@ -36,6 +36,20 @@ namespace :mysql do
task :ssh => :setup do
system "docker exec -it awdwr-mysql mysql --user=root --password=root"
end

task :start => :setup

task :restart => :start do
next if `docker ps`.include? 'awdwr-mysql'
container=`docker ps -q -a --filter name=awdwr-mysql`.chomp
system "docker start #{container}" unless container.empty?
end

task :stop do
next unless `docker ps`.include? 'awdwr-mysql'
container=`docker ps -q --filter name=awdwr-mysql`.chomp
system "docker stop #{container}" unless container.empty?
end
end

namespace :awdwr do
Expand All @@ -56,6 +70,12 @@ namespace :awdwr do
end
end

task :kill do
next unless `docker ps`.include? 'awdwr-main'
container=`docker ps -q --filter name=awdwr-main`.chomp
system "docker container kill #{container}" unless container.empty?
end

task :clobber do
next unless `docker image ls`.include? 'awdwr-main'
system "docker image rm awdwr-main"
Expand Down
12 changes: 9 additions & 3 deletions setup/common-setup
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
bash_reload=false

if [[ "$HOME" = "/home/awdwr" ]]; then
awdwr='/home/awdwr/git/awdwr'
else
awdwr=$HOME
fi

# testrails alias
if ! grep -q 'alias testrails=' ~/.bashrc ; then
echo "alias testrails='ruby `pwd`/testrails.rb'" >> ~/.bashrc
echo "alias testrails='ruby $awdwr/testrails.rb'" >> ~/.bashrc
bash_reload=true
fi

# work alias
if ! grep -q 'alias work=' ~/.bashrc ; then
echo "alias work='source `pwd`/vagrant/bin/work'" >> ~/.bashrc
echo "alias work='source $awdwr/vagrant/bin/work'" >> ~/.bashrc
bash_reload=true
fi

# depot alias
if ! grep -q 'alias depot=' ~/.bashrc ; then
echo "alias depot='bash `pwd`/vagrant/bin/depot'" >> ~/.bashrc
echo "alias depot='bash $awdwr/vagrant/bin/depot'" >> ~/.bashrc
bash_reload=true
fi

Expand Down
21 changes: 18 additions & 3 deletions testrails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ default:
output: []
message: []
rvm:
bin: ruby-2.4.1
bin: ruby-2.6.1

226:
output: 2.2.6
Expand All @@ -22,8 +22,20 @@ default:
bin: ruby-2.3.3

250:
output: 2.5.0
message: 'Ruby 2.5.0'
output: 2.5.5
message: 'Ruby 2.5.5'
rvm:
bin: ruby-2.5.5

261:
output: 2.6.1
message: 'Ruby 2.6.1'
rvm:
bin: ruby-2.6.1

270:
output: 2.7.0
message: 'Ruby 2.7.0'
rvm:
src: trunk
bin: ruby-head-n*
Expand Down Expand Up @@ -53,6 +65,9 @@ default:
branch: 5-0-stable
message: '5-0-stable'

60:
branch: master

3:
source: /home/rubys/git/awdwr/edition3
destdir: AWDwR3
Expand Down

0 comments on commit 58b0ee2

Please sign in to comment.