Commit graph

48 commits

Author SHA1 Message Date
Rafi
0d2b4c515d
Replace globals with node env (#10767) 2020-10-14 17:05:38 -04:00
dependabot-preview[bot]
ef7fc28cfd
Bump knapsack_pro from 2.2.1 to 2.3.0 (#10297)
* Bump knapsack_pro from 2.2.1 to 2.3.0

Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 2.2.1 to 2.3.0.
- [Release notes](https://github.com/KnapsackPro/knapsack_pro-ruby/releases)
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v2.2.1...v2.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump knapsack_pro from 2.2.1 to 2.3.0 (Update vendor/cache)

* Set KNAPSACK_PRO_MAX_REQUEST_RETRIES to 0 for Forks

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: mstruve <mollylbs@gmail.com>
2020-09-14 11:39:20 +07: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
Nick Taylor
b733a7c753
Auto-generate CSS utility classes documentation in Storybook (#9633)
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-08-11 23:32:14 -04:00
Molly Struve
3ad834a656
Travis Optimization:Bundle from Bash File to Use Cache (#9705) 2020-08-09 15:32:44 -05: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
Joe Doss
3e0a40741e
Update containers: DEV => Forem (#9611)
This PR moves the away from the dev specific naming to forem w/r/t container
things. Also moves to the Forem quay.io org.

* Move to Forem from DEV
* Add in assets and packs directories.
2020-08-03 16:54:45 -05:00
Molly Struve
c64e596ad9
[deploy] Feature: Enable KnapsackPro Queue Mode Take 2 (#9021) 2020-07-01 13:28:22 -04:00
Molly Struve
d9fd170a85
[deploy] Optimization: Dont Use Redis For Flare Tag IDs, Load Them On Boot (#8987) 2020-06-30 09:48:08 -05:00
Molly Struve
619aa0a684
Refactor: Remove Unused and Unecessary Code (#9000) 2020-06-29 17:30:56 -05:00
Molly Struve
cbde1a1a6a
[deploy] Revert "Feature: Introduce KnapsackPro Queue Mode (#8938)" (#8994)
This reverts commit dbdd59b83a.
2020-06-29 13:32:25 -05:00
Molly Struve
dbdd59b83a
Feature: Introduce KnapsackPro Queue Mode (#8938)
* Feature: Introduce KnapsackPro Queue Mode
* Run specs at the end to get the greatest speedup
2020-06-29 12:18:00 -05: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
Joe Doss
c5a1f37827
This should fix issue #8255 (#8408)
The logic here is wrong. We need to set CONTAINER_RUNTIME before trying to running
docker-compose/podman-compose build.
2020-06-11 16:13:18 -04:00
Molly Struve
4c4b332b2e
Allow Knapsack to work for Forks (#8413) 2020-06-11 11:59:02 -05: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
rhymes
1112cbf316
[deploy] Update webpacker configuration (#8004) 2020-05-25 12:03:18 -04: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
Thai Pangsakulyanont
5d97ca86c5
Improve docker setup script (#7378)
* Add set -e to docker-setup script

* Add error handling for db setup stage

* Sometimes Elasticsearch takes time to boot up

* Also delete docker_data

* search:setup must come first

* Revert "Sometimes Elasticsearch takes time to boot up"

This reverts commit e975f6e5c3edad084d4f2c4d8718675bf5c8d07c.

Reason for revert:
Instead of using wait-on, we can use Docker’s health check instead

See review comment:
https://github.com/thepracticaldev/dev.to/pull/7378#discussion_r411839255

* Use wait-on without installing into package.json

* Add /usr/src/app/node_modules to volumes

Otherwise, webpacker will not run in docker-compose.

See: https://stackoverflow.com/questions/30043872/docker-compose-node-modules-not-present-in-a-volume-after-npm-install-succeeds
2020-04-24 18:45:27 -04:00
Michael Kohl
741420893a
Add Solargraph gem for Gitpod (#7171) 2020-04-09 15:54:56 +02: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
briwa
604e76dd88
refactor(docker-setup): use bash instead of ruby (#6935)
* refactor(docker-setup): use bash instead of ruby

* refactor: use a proper header

* refactor: bash -> sh
2020-03-30 10:13:52 +02:00
Michael Kohl
9b12080478
A docker_setup script (#6827) 2020-03-27 18:48:32 -04:00
Molly Struve
8fb1acd903
setup ES test environment during bin/setup (#6891) 2020-03-26 13:07:06 -05:00
Michael Kohl
99da2a0863
Run rails app:update for 5.2.4.2 (#6743) [deploy]
* Run rails app:update for 5.2.4.2

* Remove bin/update and disable ActiveStorage
2020-03-23 10:38:20 -04: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
36147cce28
run Elasticsearch update before update scripts (#6504) 2020-03-06 13:27:53 -05:00
Alex
b81c2e8df3
Remove delayed_job (#6071) [deploy]
* Update adapter to sidekiq

* Remove delayed_jobs routes

* Remove delayd_jobs initializer and references

* Remove delayed_job_spec

* Remove bin/delayed_job

* Remove app/jobs/

* Migration to drop delayed_jobs table

* Remove delayed_job_web & delayed_job_active_record

* Update docs

* Remove reference to delayed_job dashboard

* Remove delayed_job settings from initializers

* Add delayed_job_admin back to reserved words list
2020-02-14 10:00:26 -08: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
Josh Puetz
af9c4832c5
Correct startup script and docs (#5940) 2020-02-06 17:04:54 -05:00
rhymes
8e6ca966ed Switch from chromedriver-helper to webdrivers (#2465) [ci skip] 2019-04-16 13:46:23 -04:00
Mac Siri
7147428821 Update Rails version on README [ci skip] 2019-04-03 14:15:17 -04:00
rhymes
3a53d5797e Upgrade Rails to 5.2.3 (#1408) 2019-04-03 13:08:59 -04:00
Abraham Williams
fdd18e6bb1 Simplify development setup (#2143) 2019-03-25 12:53:39 -04:00
Jess Lee
7bf9a8ce89 Delayed Jobs Investigation (#929)
* disallow nil reactables to be saved

* investigation wip

* passes deleted comment info to async bust cache

* fixes failing cache buster spec

* Create user_delete_a_comment_spec.rb

* Fix broken spec

* Binstub RuboCop

* Do not save comments when they are getting destroyed

* break update_reactable into smaller methods
2018-10-17 17:03:20 -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