Skip to content

Commit

Permalink
Yarn transition work-in-progress (#2659)
Browse files Browse the repository at this point in the history
* Yarn transition work-in-progress (help-wanted)

* switch to yarn attempt

* changed root location of packages

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update Dockerfile

* Update .travis.yml

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Remove reference to unneeeded installations

Keep minimal.

* Still more tweaking for switching base OS image

* Add .dockerignore

Trying with ignored Gemfile.lock

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Added yarn.lock

* Added phantomjs-prebuilt to package.json and yarn.lock

* Removed separated installation of phantomjs-prebuilt

* Run forced installation of yarn

* Removed bower.json and .bowercc

* Added noty and jquery-confirm

* Modifications in Dockerfile

* Added yarn install in .travis.yml

* Added lel packages to package.json

* Added yarn command  in .gitlab.yml

* Deleted bower command from .gitlab-ci.yml

* Changes in .gitlab-ci.yml

* Updated yarn according to bower

* Deprecated lel version

* Changes in Makefile

* Removed bower from Makefile

* Added rack-test to Gemfile

* Modified Dockerfile according to current version

* Changes in Gemfile.lock related to ruby 2.4.4

* Makefile changes related to ruby 2.4.4

* Removed bundle install command in .travis.yml

* Added i18n Gem to Gemfile

* Changes in Dockerfile related to npm error Hostname/IP doesn't match certificate's altnames

* Changes in Dockerfile related to jobs option of bundle install

* Removed Gemfile.lock in .dockerignore

* Changes in .dockerignore

* Changes in .dockerignore

* Added Gemfile.lock in Dockerfile

* Updated Gemfile.lock

* Changes in .dockerignore

* Modified way of installing bundler

* Updated Dockerfile

* Some changes in Dockerfile

* Some changes

* Changes in package.json

* Removed comments in .travis.yml

* Redeploy independent container

* Use bash command line
  • Loading branch information
jywarren authored Sep 10, 2018
1 parent d5aa3de commit 5c2bce3
Show file tree
Hide file tree
Showing 10 changed files with 2,889 additions and 96 deletions.
3 changes: 0 additions & 3 deletions .bowerrc

This file was deleted.

2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ before_script:
- docker-compose up -d
- docker-compose exec -T web rake db:setup
- docker-compose exec -T web rake db:migrate
- docker-compose exec -T web bower install --allow-root
- docker-compose exec -T web yarn --ignore-engines --ignore-scripts --modules-folder ./public/lib

job:
script:
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ install:
- netstat -ltpn
- docker-compose exec web bash -c "rake db:setup"
- docker-compose exec web bash -c "rake db:migrate"
- docker-compose exec web bower install --allow-root
- docker-compose exec web yarn --ignore-engines --ignore-scripts --modules-folder ./public/lib && yarn postinstall
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then gem install danger danger-junit; fi'

script:
Expand All @@ -28,3 +28,4 @@ script:
- echo -e '<?xml version="1.0" encoding="UTF-8"?>' > output.xml
- tail -n +2 -q ./test/reports/TEST*.xml >> output.xml
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then danger --verbose; fi'

11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,21 @@ ENV PHANTOMJS_VERSION 2.1.1
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get update -qq && apt-get install -y build-essential bundler libmariadbclient-dev ruby-rmagick libfreeimage3 wget curl procps cron make nodejs
RUN wget https://github.com/Medium/phantomjs/releases/download/v$PHANTOMJS_VERSION/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -O /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2; tar -xvf /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C /opt ; cp /opt/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin/* /usr/local/bin/
RUN npm install -g bower

# Install yarn
RUN npm config set strict-ssl false
RUN npm install -g yarn

RUN rm -r /usr/local/bundle

# Install bundle of gems
WORKDIR /tmp
ADD Gemfile /tmp/Gemfile
ADD Gemfile.lock /tmp/Gemfile.lock
RUN bundle install --jobs 4
RUN bundle install --jobs=4

ADD . /app
WORKDIR /app

RUN bower install --allow-root
RUN yarn --ignore-engines --ignore-scripts --modules-folder ./public/lib && yarn postinstall
RUN passenger-config compile-nginx-engine --connect-timeout 60 --idle-timeout 60
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ gem "php-serialize", :require => "php_serialize"
gem 'progress_bar'
gem 'rack-cors', :require => 'rack/cors'
gem "rack-openid"
gem "rack-test", "1.0.0"
gem 'rails', '5.2.0'
gem 'rails-controller-testing'
gem 'rails-dom-testing'
Expand Down
77 changes: 43 additions & 34 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ GEM
scrypt (>= 1.2, < 4.0)
authlogic-oid (1.0.4)
authlogic
hoe (>= 1.12.2)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
Expand Down Expand Up @@ -117,8 +118,8 @@ GEM
friendly_id (5.2.4)
activerecord (>= 4.0.0)
gemoji (3.0.0)
geocoder (1.4.9)
geokit (1.13.0)
geocoder (1.5.0)
geokit (1.13.1)
geokit-rails (2.3.1)
geokit (~> 1.5)
rails (>= 3.0)
Expand Down Expand Up @@ -147,6 +148,8 @@ GEM
grease (0.3.1)
hashie (3.5.7)
highline (1.7.10)
hoe (3.17.0)
rake (>= 0.8, < 13.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
http_accept_language (2.1.1)
Expand All @@ -159,7 +162,7 @@ GEM
nokogiri (~> 1)
jasmine-core (2.99.2)
jasmine-jquery-rails (2.0.3)
jasmine-rails (0.14.7)
jasmine-rails (0.14.8)
jasmine-core (>= 1.3, < 3.0)
phantomjs (>= 1.9)
railties (>= 3.2.0)
Expand Down Expand Up @@ -207,19 +210,19 @@ GEM
mimemagic (~> 0.3.2)
metaclass (0.0.4)
method_source (0.9.0)
mime-types (3.1)
mime-types (3.2.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mime-types-data (3.2018.0812)
mimemagic (0.3.2)
mini_mime (1.0.0)
mini_mime (1.0.1)
mini_portile2 (2.3.0)
minitest (5.11.3)
minitest-reporters (1.1.19)
ansi
builder
minitest (>= 5.0)
ruby-progressbar
mocha (1.5.0)
mocha (1.7.0)
metaclass (~> 0.0.1)
multi_json (1.13.1)
multi_xml (0.6.0)
Expand Down Expand Up @@ -274,7 +277,7 @@ GEM
parallel (1.12.1)
parser (2.5.1.2)
ast (~> 2.4.0)
passenger (5.3.3)
passenger (5.3.4)
rack
rake (>= 0.8.1)
phantomjs (2.1.1.0)
Expand All @@ -284,7 +287,7 @@ GEM
progress_bar (1.2.0)
highline (~> 1.6)
options (~> 2.3.0)
public_suffix (3.0.2)
public_suffix (3.0.3)
rack (2.0.5)
rack-accept (0.4.5)
rack (>= 0.4)
Expand Down Expand Up @@ -337,9 +340,9 @@ GEM
ffi (>= 0.5.0, < 2)
rb-readline (0.5.5)
rdiscount (2.2.0.1)
recaptcha (4.10.0)
recaptcha (4.12.0)
json
redis (4.0.1)
redis (4.0.2)
ref (2.0.0)
request_store (1.4.1)
rack (>= 1.4)
Expand All @@ -352,19 +355,19 @@ GEM
netrc (~> 0.8)
reverse_markdown (1.1.0)
nokogiri
rspec (3.7.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
rspec-mocks (~> 3.7.0)
rspec-core (3.7.1)
rspec-support (~> 3.7.0)
rspec-expectations (3.7.0)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-mocks (3.7.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-support (3.7.1)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rubocop (0.52.1)
parallel (~> 1.10)
parser (>= 2.4.0.2, < 3.0)
Expand All @@ -373,12 +376,12 @@ GEM
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-openid (2.7.0)
ruby-progressbar (1.9.0)
sanitize (4.6.5)
ruby-progressbar (1.10.0)
sanitize (4.6.6)
crass (~> 1.0.2)
nokogiri (>= 1.4.4)
nokogumbo (~> 1.4)
sass (3.5.6)
sass (3.5.7)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
Expand All @@ -391,16 +394,19 @@ GEM
tilt (>= 1.1, < 3)
scrypt (3.0.5)
ffi-compiler (>= 1.0, < 2.0)
sidekiq (5.1.3)
concurrent-ruby (~> 1.0)
connection_pool (~> 2.2, >= 2.2.0)
sidekiq (5.2.1)
connection_pool (~> 2.2, >= 2.2.2)
rack-protection (>= 1.5.0)
redis (>= 3.3.5, < 5)
simplecov (0.16.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
skylight (3.0.0)
skylight-core (= 3.0.0)
skylight-core (3.0.0)
activesupport (>= 4.2.0)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
Expand All @@ -425,12 +431,12 @@ GEM
tilt (2.0.8)
timecop (0.9.1)
tins (1.16.3)
turbolinks (5.1.1)
turbolinks-source (~> 5.1)
turbolinks-source (5.1.0)
turbolinks (5.2.0)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uglifier (4.1.15)
uglifier (4.1.18)
execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
Expand All @@ -442,7 +448,7 @@ GEM
coercible (~> 1.0)
descendants_tracker (~> 0.0, >= 0.0.3)
equalizer (~> 0.0, >= 0.0.9)
web-console (3.6.2)
web-console (3.7.0)
actionview (>= 5.0)
activemodel (>= 5.0)
bindex (>= 0.4.0)
Expand Down Expand Up @@ -482,6 +488,7 @@ DEPENDENCIES
grape-swagger-rails
grape-swagger-ui
http_accept_language
i18n (~> 1.0.1)
i18n-js (>= 3.0.0.rc11)
impressionist
jasmine-jquery-rails
Expand Down Expand Up @@ -512,6 +519,7 @@ DEPENDENCIES
progress_bar
rack-cors
rack-openid
rack-test (= 1.0.0)
rails (= 5.2.0)
rails-controller-testing
rails-dom-testing
Expand All @@ -532,6 +540,7 @@ DEPENDENCIES
sass-rails (~> 5.0, >= 5.0.7)
scrypt (~> 3)
sidekiq
skylight
sqlite3
teaspoon-mocha
test-unit
Expand All @@ -547,7 +556,7 @@ DEPENDENCIES
will_paginate-bootstrap (>= 1.0.1)

RUBY VERSION
ruby 2.4.1p111
ruby 2.4.4p296

BUNDLED WITH
1.16.2
23 changes: 8 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,22 @@ build:

redeploy-container:
docker-compose build --pull
docker-compose exec web rake db:migrate
docker-compose exec web bower install --allow-root
docker-compose exec web bower update --allow-root
docker-compose exec web rake assets:precompile
docker-compose exec web rake tmp:cache:clear
docker-compose run --rm web bash -c "rake db:migrate && rake assets:precompile && rake tmp:cache:clear"
docker-compose down --remove-orphans
rm -f ./tmp/pids/server.pid
docker-compose up -d
docker-compose exec -T web yarn --ignore-engines --ignore-scripts --modules-folder public/lib
docker-compose exec -T web bash -c "echo 172.19.0.1 smtp >> /etc/hosts"
docker-compose exec -T mailman bash -c "echo 172.19.0.1 smtp >> /etc/hosts"
docker-compose exec -T sidekiq bash -c "echo 172.19.0.1 smtp >> /etc/hosts"
docker-compose exec -T web bundle exec whenever --update-crontab
docker-compose exec -T web service cron start

deploy-container:
docker-compose run web sleep 5
docker-compose run web rake db:migrate
docker-compose run web bower install --allow-root
docker-compose run web bower update --allow-root
docker-compose run web rake assets:precompile
docker-compose run --rm web bash -c "sleep 5 && rake db:migrate && rake assets:precompile"
rm -f ./tmp/pids/server.pid
docker-compose up -d
docker-compose exec -T web yarn --ignore-engines --ignore-scripts --modules-folder public/lib
docker-compose exec -T web bash -c "echo 172.19.0.1 smtp >> /etc/hosts"
docker-compose exec -T mailman bash -c "echo 172.19.0.1 smtp >> /etc/hosts"
docker-compose exec -T sidekiq bash -c "echo 172.19.0.1 smtp >> /etc/hosts"
Expand All @@ -38,15 +32,16 @@ test-container:
docker-compose up -d
docker-compose exec -T web rake db:setup
docker-compose exec -T web rake db:migrate
docker-compose exec -T web yarn --ignore-engines --ignore-scripts --modules-folder public/lib
docker-compose exec -T web rake test:all
docker-compose exec -T web rails test -d
docker-compose down

install-dev:
echo "Installing RubyGems"
bundle install --without production mysql
echo "Installing Bower Packages"
bower install
echo "Installing yarn Packages"
yarn --ignore-engines --ignore-scripts --modules-folder public/lib
echo "Copying example configuartions"
cp db/schema.rb.example db/schema.rb
cp config/database.yml.sqlite.example config/database.yml
Expand All @@ -55,8 +50,6 @@ install-dev:

setup-complete:
echo "Installing Ruby"
rvm install ruby-2.1.2
rvm install ruby-2.4.4
echo "Installing Bundler"
gem install bundler
echo "Installing Bower"
yarn global add bower
39 changes: 0 additions & 39 deletions bower.json

This file was deleted.

Loading

0 comments on commit 5c2bce3

Please sign in to comment.