This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree 4 files changed +44
-30
lines changed
4 files changed +44
-30
lines changed Original file line number Diff line number Diff line change @@ -62,24 +62,33 @@ jobs:
62
62
- name : Clear
63
63
run : make ci-clear
64
64
65
- # healthcheck:
66
- # runs-on: ubuntu-latest
67
- # needs: build
68
- # steps:
69
- # - name: Checkout code
70
- # uses: actions/checkout@v4
71
-
72
- # - name: Prepare
73
- # run: cp ./.env.example ./.env
74
-
75
- # - name: Download image
76
- # uses: actions/download-artifact@v4
77
- # with:
78
- # name: bmstu_2024-app
79
- # path: /tmp
80
-
81
- # - name: Load container
82
- # run: docker load --input /tmp/bmstu_2024-app.tar
65
+ healthcheck :
66
+ runs-on : ubuntu-latest
67
+ needs : build
68
+ steps :
69
+ - name : Checkout code
70
+ uses : actions/checkout@v4
71
+
72
+ - name : Prepare
73
+ run : cp ./.env.example ./.env
74
+
75
+ - name : Download image
76
+ uses : actions/download-artifact@v4
77
+ with :
78
+ name : bmstu_2024-app
79
+ path : /tmp
80
+
81
+ - name : Load container
82
+ run : docker load --input /tmp/bmstu_2024-app.tar
83
83
84
- # - name: Healthcheck
85
- # run: make ci-up-healthy
84
+ - name : Make user
85
+ run : |
86
+ adduser -D rails --shell /bin/ash
87
+ chmod 777 .
88
+
89
+ - name : Healthcheck
90
+ run : make ci-up-healthy
91
+
92
+ - name : Clear
93
+ run : make ci-clear
94
+
Original file line number Diff line number Diff line change @@ -39,12 +39,10 @@ RUN bundle exec bootsnap precompile app/ lib/
39
39
# Precompiling assets for production without requiring secret RAILS_MASTER_KEY
40
40
RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
41
41
42
- RUN adduser -D rails --shell /bin/bash
42
+ RUN adduser -D rails --shell /bin/ash
43
43
RUN mkdir -p /usr/local/bundle/ruby/3.2.0/cache
44
- RUN chown -R rails:rails \
45
- db log storage tmp \
46
- /usr/local/bundle/ruby/3.2.0/cache
47
- RUN chmod -R 777 /usr/local/bundle/ruby/3.2.0/cache
44
+ RUN chown -R rails:rails storage /usr/local/bundle/ruby/3.2.0/cache
45
+ RUN chmod -R 755 /usr/local/bundle/ruby/3.2.0/cache
48
46
49
47
USER rails:rails
50
48
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ GID := $(shell id -g)
6
6
include .env
7
7
export
8
8
9
+ RAILS_ENV ?= development
10
+
9
11
setup : build db-prepare
10
12
11
13
build :
@@ -52,7 +54,7 @@ db-psql:
52
54
db-prepare : db-drop db-create db-migrate db-seed
53
55
54
56
db-create :
55
- docker compose run --rm app bin/rails db:create RAILS_ENV=development
57
+ docker compose run --rm app bin/rails db:create RAILS_ENV=${RAILS_ENV}
56
58
57
59
db-migrate :
58
60
docker compose run --rm app bin/rails db:migrate
@@ -70,11 +72,11 @@ db-drop:
70
72
docker compose run --rm app bin/rails db:drop
71
73
72
74
ci-build :
73
- bundle lock --update
74
- npm install --package-lock-only
75
- docker compose build -q
75
+ docker compose build
76
76
77
- ci-up-healthy : db-prepare
77
+ ci-up-healthy :
78
+ export CI=
79
+ RAILS_ENV=test make db-prepare
78
80
docker compose up -d --wait --wait-timeout 60
79
81
80
82
ci-rubocop : rubocop
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
3
require 'active_support/core_ext/integer/time'
4
+ require 'logger'
4
5
5
6
# The test environment is used exclusively to run your application's
6
7
# test suite. You never need to work with it otherwise. Remember that
7
8
# your test database is "scratch space" for the test suite and is wiped
8
9
# and recreated between test runs. Don't rely on the data there!
9
10
10
11
Rails . application . configure do
12
+ # if ENV['CI'].present?
13
+ # config.logger = Logger.new($stdout)
14
+ # ENV['TMPDIR'] = '/tmp'
15
+ # end
11
16
# Settings specified here will take precedence over those in config/application.rb.
12
17
13
18
# While tests run files are not watched, reloading is not necessary.
You can’t perform that action at this time.
0 commit comments