Commit b0d8ac13 authored by mh's avatar mh
Browse files

cleanup gemfile + introduce gitlab ci

* Remove some unneeded deps
* Add gitlab ci similar to how users has, although currently we do
  have any proper tests, it still checks something
* Introduce a ci task that runs the steps to prepare the app after
  checkout from git
parent cc137c3f
Pipeline #3957 failed with stages
in 4 minutes and 23 seconds
stages:
- test
- prod_setup
image: $CI_REGISTRY/immerda/container-images/ruby:2.5
test:
stage: test
tags:
- container
script:
- cp test/local_conf.yml config/
- yum install -y rh-ruby25-ruby-devel libxml2-devel gcc openssl-devel gcc-c++ tar gzip bzip2 patch
- bundle install --jobs $(nproc) || bundle update rails
- bundle exec rails test
prod_setup_check:
stage: prod_setup
tags:
- container
script:
- cp test/local_conf.yml config/
- yum install -y rh-ruby25-ruby-devel libxml2-devel gcc openssl-devel gcc-c++ tar gzip bzip2 patch
- rm -rf vendor/bundle
- export SECRET_KEY_BASE=$(openssl rand -base64 32)
- export RAILS_ENV=production
- bash -ex ./scripts/prepare_for_prod.sh
......@@ -5,9 +5,6 @@ ruby '~> 2.5'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.0'
# nodejs version too old on EL7, TODO: remove once migrated
gem 'autoprefixer-rails', '~> 9.7.6'
# Use Puma as the app server
gem 'puma', '~> 4.0'
gem 'rucaptcha'
......@@ -19,9 +16,7 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'rest-client'
gem 'zxcvbn-ruby', require: 'zxcvbn'
gem 'uglifier', '>= 1.3.0',
require: (ENV['RAILS_ENV'].to_s.downcase != 'production' ||
ENV['PRECOMPILE'].to_s == '1')
gem 'uglifier', '>= 1.3.0'
group :development do
gem 'listen', '>= 3.0.5', '< 3.2'
......
......@@ -43,8 +43,6 @@ GEM
minitest (~> 5.1)
tzinfo (~> 1.1)
arel (9.0.0)
autoprefixer-rails (9.7.6)
execjs
builder (3.2.4)
concurrent-ruby (1.1.7)
crass (1.0.6)
......@@ -152,7 +150,6 @@ PLATFORMS
ruby
DEPENDENCIES
autoprefixer-rails (~> 9.7.6)
jsobfu
listen (>= 3.0.5, < 3.2)
puma (~> 4.0)
......
#!/bin/bash -e
if [ -z $SECRET_KEY_BASE ]; then
echo "SECRET_KEY_BASE is not defined, which is required!"
exit 1
fi
export RAILS_ENV=${RAILS_ENV:-production}
bundle lock
bundle install --path=vendor/bundle --standalone --without development --without test
bundle exec rake tmp:cache:clear
bundle exec rake assets:clean
bundle exec rake assets:precompile
......@@ -13,10 +13,6 @@ fi
user=$(stat -c%U $base_path)
su - $user -s /bin/bash -c "cd $base_path && git pull -q"
su - $user -s /bin/bash -c "cd $base_path && scl enable rh-ruby25 'bundle lock'"
su - $user -s /bin/bash -c "cd $base_path && scl enable rh-ruby25 'bundle install --path=vendor/bundle --standalone --without development'"
su - $user -s /bin/bash -c "cd $base_path && SECRET_KEY_BASE=$skb scl enable rh-ruby25 'bundle exec rake tmp:cache:clear'"
su - $user -s /bin/bash -c "cd $base_path && SECRET_KEY_BASE=$skb scl enable rh-ruby25 'bundle exec rake assets:clean'"
su - $user -s /bin/bash -c "cd $base_path && SECRET_KEY_BASE=$skb scl enable rh-ruby25 'bundle exec rake assets:precompile'"
su - $user -s /bin/bash -c "cd $base_path && SECRET_KEY_BASE=$skb scl enable rh-ruby25 -- $base_path/scripts/prepare_for_prod.sh"
[ "${1}" == 'without-restart' ] || su - $user -s /bin/bash -c "touch ${base_path}/tmp/restart.txt"
require 'test_helper'
class AdminControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
require 'test_helper'
class AppPasswordsControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
require 'test_helper'
class DeleteAccountControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
require 'test_helper'
class DomainsControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
require 'test_helper'
class IndexControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
require 'test_helper'
class InvitesControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
require 'test_helper'
class TreesControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
require 'test_helper'
class TreesTokenControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
require 'test_helper'
class PasswordControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
require 'test_helper'
class RecoveryEmailControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
require 'test_helper'
class SessionsControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
require 'test_helper'
class SignupControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
require 'test_helper'
class UsersControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
-----BEGIN CERTIFICATE-----
MIIDLTCCAhWgAwIBAgIUWpMb6M45ewdOQQvYM0Qb/TKRrz0wDQYJKoZIhvcNAQEL
BQAwDDEKMAgGA1UEAwwBeTAeFw0yMDA5MjgyMTI3MjhaFw0zMDA5MjYyMTI3Mjha
MAwxCjAIBgNVBAMMAXkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC+
Gd+rjS+4Pw8ILSkM2pkS17dQs0S4gPsK9pIGGJhxLciSDBVQ7h+ErDt5hVQKvqD7
33wFZBrBVq3WWugIyUumVT8xYwL8+QAmjM2+Q9KVBEh4JThRiB+AJpbwR8KpHQCc
L36mXeR9eOCjhFxxUOSGK60TMrFw/+kkL1SPtL53b+aRc++YkgbW1K/kApO+Gnni
+B78WIRD4B5O+Jj8+v/ZPHcWuYKoytNdlbeLON2+GwDHhTtnRaKjDwyq77fi3yYk
mWJf9G6kUT316VRojWVRKR+P3+Ow0JVOf13hBtInXy8o4+qG4h6IyRLFgOGqqSvS
tAgrJ0YYcUk6aq74h07RAgMBAAGjgYYwgYMwHQYDVR0OBBYEFLqm7/LoO2ngK1NS
ygycGicewoDaMEcGA1UdIwRAMD6AFLqm7/LoO2ngK1NSygycGicewoDaoRCkDjAM
MQowCAYDVQQDDAF5ghRakxvozjl7B05BC9gzRBv9MpGvPTAMBgNVHRMEBTADAQH/
MAsGA1UdDwQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAQEAVbxHL14TUQhKm1uRTurc
xyR2EtOQ4I3n5xVVkMxjr96GyAKdXshkbNDkdsCo/R8A9emzk2soZNfFLuYxsP2W
7O96J5IR7wLjCqRaPCu4Zm4fve262qrY+RP9pRNM+TpT3mqZLwvyJF3gpojz/LLJ
pwTVJteNJtcUIPZzdTXM0GmGwsauTwLavImvZ22Qisr325tSPThhuPr7Vyt/9A4i
f5J0jCtvqAnF+Tl62vlEHaPMk3Wa7iZbIK6JvakEK1rlcA7rLATrjms0BojoadXj
bdtUj0mt8b9kvgLEKNHCimS2K3EGS94Rp0z9Oo7Q1s46DNcQLpzCvyll/JPmn26X
oA==
-----END CERTIFICATE-----
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
90:c4:50:44:81:1a:55:38:3d:b6:6a:bb:90:1d:51:3f
Signature Algorithm: sha256WithRSAEncryption
Issuer: CN=y
Validity
Not Before: Sep 28 21:27:29 2020 GMT
Not After : Jan 1 21:27:29 2023 GMT
Subject: CN=login.immerda.ch
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public-Key: (2048 bit)
Modulus:
00:d6:92:4b:72:cd:94:c4:fa:f5:85:03:2e:cc:c1:
54:97:7a:8b:77:52:ad:a5:a2:e6:d7:c6:33:dc:4d:
55:3f:60:25:61:27:55:44:4c:ea:17:d5:32:e1:ad:
d6:a4:b1:b6:30:75:c7:77:d9:16:81:1e:28:9c:31:
46:55:9e:e4:d9:7d:6b:52:47:77:60:39:86:00:88:
3a:af:2d:cf:c2:ea:4d:9f:ba:30:5a:5b:f4:7e:95:
ca:72:94:d9:c1:7b:4c:fd:75:7b:57:12:99:87:4b:
b8:b3:89:1e:65:dd:68:00:7b:55:ce:62:b3:69:a2:
fe:7a:30:7f:84:38:e8:ed:a9:e3:e8:30:4f:ab:62:
07:95:72:0c:67:0d:dc:64:fc:db:11:bf:fe:9f:ec:
6c:03:1b:bf:bd:ca:cf:9d:bb:b8:fe:cf:ea:b3:81:
d6:e3:3d:8b:61:ad:3d:e5:72:8c:22:b8:6d:88:78:
a3:1c:93:f5:27:5a:ab:0a:e4:ea:a8:d4:b1:30:2a:
2e:eb:a7:37:40:5e:ca:e1:86:52:06:41:b9:57:35:
66:e5:07:61:e8:0b:55:c0:8e:b2:aa:ad:06:1b:cd:
5f:1e:4e:b7:9a:0a:bd:b6:b1:04:d8:97:24:6b:43:
ee:37:28:d8:e0:6e:12:58:b5:86:bc:74:32:5f:9a:
04:77
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
X509v3 Subject Key Identifier:
C7:CF:38:00:19:66:A8:55:14:94:5B:68:6F:86:32:AB:96:4A:FB:DF
X509v3 Authority Key Identifier:
keyid:BA:A6:EF:F2:E8:3B:69:E0:2B:53:52:CA:0C:9C:1A:27:1E:C2:80:DA
DirName:/CN=y
serial:5A:93:1B:E8:CE:39:7B:07:4E:41:0B:D8:33:44:1B:FD:32:91:AF:3D
X509v3 Extended Key Usage:
TLS Web Client Authentication
X509v3 Key Usage:
Digital Signature
Signature Algorithm: sha256WithRSAEncryption
84:76:96:52:6a:38:14:68:91:b4:00:4f:53:f8:70:a8:1d:ab:
25:27:c0:55:0b:18:fc:f5:28:14:69:87:10:d4:51:fb:9b:e9:
2d:17:5c:03:43:f1:6e:19:09:95:fc:67:97:2e:e8:25:ed:b4:
5c:dc:30:c7:ec:98:76:0f:c6:74:56:c7:69:7b:21:4d:35:e3:
59:a9:fc:11:9c:63:7a:0f:1b:d0:30:68:48:ad:47:f3:ee:eb:
39:c4:17:69:6a:b9:76:5b:d7:62:1a:89:b5:cb:ce:a6:56:bc:
f9:cf:a7:c7:1a:df:e5:a3:08:93:11:fd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Jx7CgNqhEKQOMAwxCjAIBgNVBAMMAXmCFFqTG+jOOXsHTkEL
2DNEG/0yka89MBMGA1UdJQQMMAoGCCsGAQUFBwMCMAsGA1UdDwQEAwIHgDANBgkq
hkiG9w0BAQsFAAOCAQEAhHaWUmo4FGiRtABPU/hwqB2rJSfAVQsY/PUoFGmHENRR
+5vpLRdcA0PxbhkJlfxnly7oJe20XNwwx+yYdg/GdFbHaXshTTXjWan8EZxjeg8b
0DBoSK1H8+7rOcQXaWq5dlvXYhqJtcvOpla8+c+nxxrf5aMIkxH9nhnvFCKk89Bt
Bjzvcyy5CvREVyUsz0lZ2diGNFDudlFeQYW5jhaig2aKdDDBK90s+ded3RjsQgjz
S35kPO5KzmvUTZSF+QsvLdO2zKE9jZyTSKk6CI7w1Wk1uNkuylaCVzM958dNWIZU
YBLj11iMzwwyG4TxUiAyHZ6Chpg8PvGd/yLtN9Lutw==
-----END CERTIFICATE-----
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment