Commit graph

25 commits

Author SHA1 Message Date
rhymes
b6360fb80c
Upgrade Rails to 6.1.3.1 (#11333)
* Upgrade Rails to 6.1

* Switch to unreleased bullet

* Run rails app:update

* Add deprecation notices after reading changelogs

* Fix app:update error

* Move middleware in the correct place

* Temporarily disable ransack which does not support Rails 6.1

* Remove wrongly merged file

* Re-run spring binstub

* Fix double quotes

* Track ransack branch with Rails 6.1 support

* Fix deprecation

* Switch to Ransack 2.4 which supports Rails 6.1 rc1

* Fix missing default params for the duration substitution

* Fix new behavior of relation.pluck with contradictory queries

* Fix uploaders specs by tracking rspec-rails main repo

* Disable bullet temporarily

* Fix remaining fixture_file_upload usages

* Add default seconds for video article duration

* Trigger Travis CI

* Upgrade Rails to 6.1.0.rc2

* Remove file deleted on master

* Add Rails 6.1 gem to Gemfile

* Trigger Travis CI

* Revert "Disable bullet temporarily"

This reverts commit cee0c2ce61fb72cbc16d52c94b12ee681e873031.

* Fix bullet version

* Upgrade to acts-as-taggable 7 and fix conflict

* Update Gemfile and rspec-* gems

* Fix nokogiri in Gemfile.lock

* Switch to rspec-rails main branch

* Remove leftover vendored cached items

* Fix path for Rails 6.1

* Use latest release of erb_lint

* Re-run rails app:update to incorporate new changes

* Disable erb_lint's ErbSafety checks

* Fix Gemfile.lock and re-add platform specific gems of Nokogiri

* Add mini_portile2 as well

* Fix latest merge conflict by removing now unused faraday_middleware

* Upgrade to Rails 6.1.3.1

* Regenerate Gemfile.lock and vendor/cache

* Add x86_64 linux gem

* Mark spec as flaky

* Revert "Mark spec as flaky"

This reverts commit 3caba94b33645f9b59c84ba78ee8df042fc7aee0.

Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2021-04-05 10:39:48 -04:00
Josh Puetz
80e8129628
Configurre bundler to ignore Rpush install message (#13025) 2021-03-17 10:55:11 -05:00
Molly Struve
2bc1496bc4
Refactor: Remove Unused Figaro Gem and Temp Rake Task (#10255) 2020-09-09 09:24:32 +02:00
Molly Struve
a5553cf296
Warning Fix: Rename Unused application.yml File to Prevent Warnings (#9860) 2020-08-18 16:49:34 -05:00
Molly Struve
0a64ac067b
[deploy] Remove ENVied Gem, Use dotenv Take 2 (#9767) 2020-08-14 12:20:47 -05:00
rhymes
e727956640
Revert "[deploy] Refactor:Remove ENVied Gem, Use dotenv Instead for Test and Development (#9621)" (#9757)
This reverts commit 1be8c72206.
2020-08-12 13:28:38 -04:00
Molly Struve
1be8c72206
[deploy] Refactor:Remove ENVied Gem, Use dotenv Instead for Test and Development (#9621)
* Refactor:Remove ENVied Gem in Favor of Default application.yml

* Copy sample_application.yml for Travis

* Create .env_sample file, Warn of missing ENV variables, ignore .env file

* Use dotenv For ENV variables and create Rake Task to Populate

* Update docs to copy .env_sample file

* make application config a bit more resilient

* update more documentation and only initialize dotenv in dev and test

* Update doc code snippet types and refactor rake task and app config

* remove push defaults

* Make initializers more resilient, remove unused ENV from travis

* Exit new rake task if application.yml does not exist, include dotenv in docs
2020-08-12 11:01:38 -04:00
Michael Kohl
c2d23cfc4d
[deploy] Seed profile fields (#9605)
* Fix schema.rb

* Add service objects for base and link fields

* Add link fields to seeds

* Make placeholder a keyword argument

* Add work fields

* Add explanation column to profile fields

* Add coding fields

* Switch from inheritance to mixin

* Add email checkbox to base fields

* Add branding fields

* Add spec for ProfileFields::FieldDefinition

* Move migration back into correct location

* Rename column from explanation to description

* Rename attribute in mixin

* chore: rename from explanation to description

* Add ProfileFields::ImportFromCsv

* Simplify ProfileFields::ImportFromCsv

* Add comment about disabled cop to spec

* Add TODO comment to Rake task

* Document mixin

* Add groups to profile fields

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2020-08-05 10:11:30 -04:00
Jacob Herrington
b603e03348
Conditionally install foreman during setup (#8391)
We should avoid install foreman during `bin/setup` if it is already
installed.
2020-06-22 19:47:57 -04:00
Ernesto Tagwerker
9ea3a8c67d
Upgrade to Rails 6.0 (#7658)
* Add dual booting logic to Gemfile

This might be helpful for the Rails 6.0 upgrade project.

* Add more than one gemfile to Travis' configuration

We want to see how the application behaves with more than one Rails versions:

- Gemfile -> Rails 5.2
- Gemfile.next -> Rails 6.0

This will help us figure out what needs to be addressed before migrating to Rails 6.0.

If you want to read more about this technique (dual booting) you can check out this page: https://www.fastruby.io/blog/upgrade-rails/dual-boot/dual-boot-with-rails-6-0-beta.html

* Fix joins

* Upgrade Gemfile.next.lock

* Make sure we're installing the correct versions of gems

* Add Rails 6 notes

* Update rubocop in Gemfile.next.lock

* Fix organization spec

* Fix page_views_spec

* Add Rails 6 and run rails app:update

* Remove some tricks

* Remove Gemfile.next for now

* Fix .content_type deprecation

* Fix deprecation of .where.not NAND/NOR behavior

* Fix deprecation of parameterized emails

* Fix specs

* Remove next flag for now

* Fix spec (hopefully)

* Add wait_for_javascript

* Fix spec, thanks @maestromac!

* Try without wait for javascript hack

* Remove unnecessary bin/update

* Remove file that snuck in the rebase

* Update the vendored gems

* Replace migrate+db:setup with db:prepare

* Update vendored gems

* Fix Gemfile.lock and update vendored stuff

* Fix Gemfile.lock to be the same as master's minus the changes

Co-authored-by: rhymes <rhymesete@gmail.com>
2020-06-04 11:54:25 +02:00
Joe Doss
aa49cb1cfe
Bugfix for #7663 and refactor of container setup (#7747)
* Move from Alpine Linux to Fedora Linux.

This changes the base container image away from Alpine Linux to
Fedora Linux to address some musl libc issues with some of our gems.

It also moved the main file to a Containerfile and symlinks the Dockerfile
to it. This makes our container setup less Docker-centric as Linux users
most likely will be using Podman as their container runtime.

Lastly, it moves the WORKDIR from /usr/src/app to /opt/apps/devto.
The Linux FHS states that /opt is the spot for Optional application
software packages and /usr/src is for kernel source code.

https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

/opt Optional application software packages
/usr/src Source code, e.g., the kernel source code with its header files.

Also, if SELinux becomes a thing in our future, moving this makes it
easier to manage contexts out of /opt rather than /usr/src.

* Adjust the Containerfile a bit to add some missing packages, make it
more generic and move env vars to the docker-compose.

* Move the Dockerfile to a symlink to the Containerfile.

We need to be able to support more than just Docker for a container
runtime. Moving everything to a Containerfile and symlinking the
Dockerfile helps users run runtimes such as Podman.

* Add in new entrypoint files and fix the app path in docker-entrypoint.sh

* Refactor the docker-compose.yml file so it doesn't build the main
application container three times in a row. We can use the same
container for web, webpacker, and sidekiq.

Also make the volume names very explicit on what their contents and add
in SELinux context support with :Z

* Fix ELASTICSEARCH_URL.

* Remove the absolute path on ip binary and add in iproute to Containerfile.

* Symlink the Dockerfile to Containerfile and add in a container-compose.yml file
for usage with podman-compose. We are waiting for this issue to get resolved

https://github.com/containers/libpod/issues/6153

and for podman-compose to mature a bit more. A user using podman-compose can use

podman-compose -f container-compose.yml

to launch the DEV container stack with Podman.

* Update the .gitignore file to reflect the new container volumes.

* Fix the entrypoint script on the Containerfile and clean up a bunch of things.

* Rework the Containerfile to prep it to run as a non-root user. We have to wait
for this issue to get fixed:

https://github.com/containers/libpod/issues/6153

for Linux users and then we can uncomment the USER line so we are running Rails
as a non-root user. :toot:

* This reworks the compose files so each task that is needed to start the app has
a correct wait command with dockerize. It also adds in containers for doing
yarn and bundle things for development. Since we mount the code directory inside
the container we lose our pre-containerized gems and node_modules.

This means users can run:

Linux
podman-compose -f container-compose.yml up

Mac
docker-compose up

and it should correctly build the app stack with containers!

* Clean up old container related things.

* Add in some container pre-reqs and my name to the "Core team" section! :toot:

* Adjust the seed and sidekiq compose entries so they do not use the web entrypoint
and set the REDIS_URL and REDIS_SESSIONS_URL env vars for seed.

Add in some echos to the entrypoint.sh.

Also set docker-compose to use :delegated on mount points to speed things up.

https://docs.docker.com/storage/bind-mounts/#configure-mount-consistency-for-macos

* Just call yarn install --dev on the yarn container.

* Update documentation to support Docker and Podman as Container Engines and
move the page from docker to containers to reflect the fact not all users run
their containers via Docker.

There are dozens of us... DOZENS!

* Set --local on bundle config so it just impacts this Ruby app.

* Renamed bin/docker-setup to bin/container-setup to reflect the fact that that
we can use Podman as a container engine. I also refactored it so it does some
basic pre-flight checks for docker and docker-compose or podman and
podman-compose to make sure users have a container engine installed.

* Set cache_all_platforms true for bundler.

* Bump docker-compose dockerize -timeout to 45min for slower macOS hardware.

* Move to the consolidated app_initializer:setup rake task for bootstrapping the
app.

* Update docs/installation/readme.md
2020-05-28 12:11:51 -05:00
Molly Struve
182faa0289
[deploy] Consolidate Setup Tasks to a Single Rake Task (#8065) 2020-05-27 11:59:07 -05:00
Joe Doss
f7a3664415
Let's cache our gems in vendor/cache! (#8066)
* Let's cache our gems in vendor/cache!

This PR adds in bundle package caching which will help speed up deployments by
caching all of the gems that we use in our git repo. This was done with the
following commands on a fresh repo clone:

bundle install
bundle package --all

This cached all of our gems in vendor/cache and when you do a bundle install to
update gems from the Gemfile, it will update our gem cache too.

You can read more about bundle package here:

https://bundler.io/man/bundle-package.1.html

* Add in bundle config set cache_all true to bin/setup so it gets set for everyone.
2020-05-27 11:29:55 -05:00
Mac Siri
a9cead5c91
Update bin/setup's db setup logic (#7644)
* Update bin/setup's db setup logic

* Remove duplicate seeds
2020-05-01 11:32:54 -04:00
Molly Struve
b4644783ef
setup Elasticsearch before we setup the database for new dev environments (#7534) 2020-04-27 10:42:35 -05:00
Michael Kohl
1d069d8ed1
Unset DATABASE_URL in .gitpod.yml (#7059)
* Unset DATABASE_URL in .gitpod.yml

* Only run bin/setup once

* Try alternative approach for unsetting DATABASE_URL

* Update bin/setup

* Consistently use db_url

* Fix bug caused by typo (= instead of ==)
2020-04-03 15:56:43 +02:00
Molly Struve
8fb1acd903
setup ES test environment during bin/setup (#6891) 2020-03-26 13:07:06 -05:00
rhymes
235367e073
Make bin/setup predictable and repeatable and remove bin/update (#6566)
* Make bin/setup predictable and remove bin/update

* System not puts

* Give priority to ENV DATABASE_URL
2020-03-10 15:46:23 +01:00
Molly Struve
0bfbd9bb1f
Set Up Framework For Running Data Update Scripts (#6025) [deploy] 2020-02-13 10:48:23 -05:00
Mac Siri
a4a846fc74
Add foreman to bin/setup (#6007) 2020-02-10 16:08:57 -05:00
Molly Struve
a13533c920
Setup Elasticsearch indexes during Deploy and Local App Setup (#5939)
* setup Elasticsearch indexes during deploy and local app setup

* cleanup previous duplicate sentence

* remove more duplicate docs
2020-02-07 09:01:58 -05:00
rhymes
3a53d5797e Upgrade Rails to 5.2.3 (#1408) 2019-04-03 13:08:59 -04:00
rhymes
e588fa7ece Code cleanups (#659)
* Initial automatic cleanup with rubocop

* Fix syntax error introduced by rubocop

* Cleanup seeds file

* Cleanup lib folder

* Exclude bin folder because it contains auto generated files

* Make Rubocop a little bit more chatty

* Block length should not include comments in the count

* Cleanup config folder

* Cleanup specs

* Updated Rubocop version and generated a todo file

* Fix broken ArticlesApi spec

* Fix tests

* Restored rubocop pre-commit hook
2018-08-07 11:00:13 -04:00
Andy Zhao
96c97d3a3e Update readme with new ways for dev env data (#85)
* Update readme with new ways for dev env data

* Make download data instructions more clear
2018-03-16 14:16:42 -04:00
Mac Siri
301c6080e3 Initial commit 2018-02-28 16:11:08 -05:00