Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/rails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ jobs:
with:
node-version: '20'

- name: 'Setup yarn berry'
run: npm install -g corepack && corepack enable

- name: 'Run database migrations'
env:
RAILS_ENV: test
Expand Down
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ spec/coverage/.last_run.json
/public/uploads
/node_modules

# Ignore yarn stuff
.yarn/*
!.yarn/cache
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Created by https://www.gitignore.io/api/intellij

Expand Down Expand Up @@ -90,7 +98,7 @@ config/environments/*.local.yml
config/docker/*/home/rails/.bundle
config/docker/*/home/rails/.cache
config/docker/*/home/rails/.local
config/docker/*/home/rails/.yarnrc
config/docker/*/home/rails/.yarn
config/docker/*/home/rails/.irb_history
config/docker/*/home/rails/.bash_history
config/docker/*/home/rails/Downloads
Expand Down
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
# Variables #
#################################


# Versioning
ARG RUBY_VERSION="3.4.1"
ARG BUNDLER_VERSION="2.5.6"
ARG NODEJS_VERSION="18"
ARG YARN_VERSION="1.22.10"

# Packages
ARG BUILD_PACKAGES="nodejs build-essential shared-mime-info"
ARG RUN_PACKAGES="shared-mime-info postgresql graphicsmagick"

# Scripts
ARG PRE_INSTALL_SCRIPT="curl -sL https://deb.nodesource.com/setup_${NODEJS_VERSION}.x -o /tmp/nodesource_setup.sh && bash /tmp/nodesource_setup.sh"
ARG INSTALL_SCRIPT="node -v && npm -v && npm install -g yarn && yarn set version ${YARN_VERSION}"
ARG INSTALL_SCRIPT="node -v && npm -v && npm install -g corepack && corepack enable
ARG PRE_BUILD_SCRIPT
ARG BUILD_SCRIPT="yarn install && bundle exec rake assets:precompile"
ARG POST_BUILD_SCRIPT="echo \"(built at: $(date '+%Y-%m-%d %H:%M:%S'))\" > /app-src/BUILD_INFO"
Expand Down
3 changes: 2 additions & 1 deletion config/docker/development/Rails.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ USER root

ENV RAILS_ENV=development
ENV BUNDLE_PATH=/opt/bundle
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0

WORKDIR /myapp

Expand All @@ -16,7 +17,7 @@ RUN apt-get install direnv -y
RUN apt-get install firefox-esr -y
RUN apt-get install -y nodejs
RUN apt-get install -y graphicsmagick
RUN npm install -g yarn
RUN npm install -g corepack && corepack enable

RUN mkdir /opt/bundle && chmod 777 /opt/bundle
RUN mkdir /seed && chmod 777 /seed
Expand Down
2 changes: 1 addition & 1 deletion config/docker/development/rails-entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ echo "running bundle install"
gem install bundler -v 2.4.10
bundle install

yarn install --check-files
yarn install

if [ -z "$SKIP_RAILS_MIGRATIONS" ]; then
echo "⚙️ Performing migrations"
Expand Down
3 changes: 2 additions & 1 deletion config/docker/test/Test.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ USER root

ENV RAILS_ENV=test
ENV BUNDLE_PATH=/opt/bundle
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0

WORKDIR /myapp

Expand All @@ -16,7 +17,7 @@ RUN apt-get install direnv -y
RUN apt-get install firefox-esr -y
RUN apt-get install -y nodejs
RUN apt-get install -y graphicsmagick
RUN npm install -g yarn
RUN npm install -g corepack && corepack enable

RUN mkdir /opt/bundle && chmod 777 /opt/bundle
RUN mkdir /seed && chmod 777 /seed
Expand Down
2 changes: 1 addition & 1 deletion config/docker/test/test-entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ echo "running bundle install"
gem install bundler -v 2.4.10
bundle install

yarn install --check-files
yarn install

if [ -z "$SKIP_RAILS_MIGRATIONS" ]; then
echo "⚙️ Performing migrations"
Expand Down
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@
t.integer "department_id"
t.string "shortname"
t.boolean "display_competence_notes_in_cv", default: true, null: false
t.boolean "reminder_mails_active", default: true
t.string "ptime_data_provider"
t.integer "ptime_employee_id"
t.boolean "reminder_mails_active", default: true
t.index ["company_id"], name: "index_people_on_company_id"
end

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ services:
/bin/bash -c "
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - &&
apt-get install -y nodejs &&
npm install -g yarn && bin/assets &&
npm install -g corepack && corepack enable && bin/assets &&
sleep infinity"
volumes:
- ./:/myapp
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@
],
"engines": {
"npm": "please-use-yarn",
"yarn": ">= 1.22.0",
"yarn": ">= 4.0.0",
"node": ">= 18.16.0"
},
"devDependencies": {
"husky": "^9.0.11"
}
},
"packageManager": "yarn@4.9.2"
}
Loading