stack_car 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e8df8e8dbd70e738de0a61cd09489c72e4cd822326b237269d21ebe4dacd258
4
- data.tar.gz: 11214bdf66ad316ad4feec518f0ef0e39f9e146aea500c3b7e187a67ecaa33fe
3
+ metadata.gz: be5319f55289a7290898afd746925c52ca00abd632f8c8bb15bc9fd9ef42b91b
4
+ data.tar.gz: 5fc7e21e1ff7bb056ddcdfe2fd35da741f5d0d27e9f7491ce7dee44483a2e50f
5
5
  SHA512:
6
- metadata.gz: 65b81508cd79dd4fdff903820133034b4dc894eeaff69a3033e2439b9cae81f5b34e48055a83485e56f3236ea7111cc9dc24d3c8a3a8cdb8341a5b64490e070a
7
- data.tar.gz: 60223a2ce56c3173e4c62b8d08e05e1d8c6c5fcd2c64027864cef6aa76857c88e3b9a9ae2d6c88cd4a229f2c858f1f1359959b849faffe129119258500b97b2c
6
+ metadata.gz: e911986bdbecd0848db4a0987eb631f52d0e76271c67f06761a0364332db693c25bf0f34911169dd9a2caeb907c74e095d98a6352d1fc9264cacf15dddef1cf2
7
+ data.tar.gz: 3a8790e739b56f07648edb147f9dd2dde7e77875c3b45ccadb342d243880ceee34a97f5e1da236d2204a65778409c26a196c74c08c87e906a7297bc81829aac6
data/lib/stack_car/cli.rb CHANGED
@@ -165,7 +165,7 @@ module StackCar
165
165
  method_option :elasticsearch, default: false, type: :boolean, aliases: '-e'
166
166
  method_option :fcrepo, default: false, type: :boolean, aliases: '-f'
167
167
  method_option :helm, default: false, type: :boolean, aliases: '-h'
168
- method_option :git, default: true, type: :boolean, aliases: '-g'
168
+ method_option :git, default: false, type: :boolean, aliases: '-g'
169
169
  method_option :heroku, default: false, type: :boolean, aliases: '-h'
170
170
  method_option :hyku, default: false, type: :boolean, aliases: '-u'
171
171
  method_option :imagemagick, default: false, type: :boolean, aliases: '-i'
@@ -214,7 +214,7 @@ module StackCar
214
214
  post_apt << "cd /opt && unzip fits-1.0.5.zip && chmod +X fits-1.0.5/fits.sh"
215
215
  end
216
216
 
217
- ['.dockerignore', 'Dockerfile', 'Dockerfile.base', 'docker-compose.yml', '.gitlab-ci.yml', '.env'].each do |template_file|
217
+ ['.dockerignore', 'Dockerfile', 'docker-compose.yml', '.gitlab-ci.yml', '.env'].each do |template_file|
218
218
  puts template_file
219
219
  template("#{template_file}.erb", template_file)
220
220
  end
@@ -344,6 +344,7 @@ module StackCar
344
344
 
345
345
  def setup
346
346
  if File.exists?('stack_car')
347
+ @sc_dir = true
347
348
  Dir.chdir('stack_car')
348
349
  self.destination_root += "/stack_car"
349
350
  end
@@ -1,3 +1,3 @@
1
1
  module StackCar
2
- VERSION = "0.12.0"
2
+ VERSION = "0.13.0"
3
3
  end
@@ -1,5 +1,6 @@
1
1
  stages:
2
2
  - build
3
+ - lint
3
4
  - test
4
5
  - deploy
5
6
 
@@ -1,14 +1,13 @@
1
1
  FROM CHANGEME/base:latest
2
- <% if options[:git] %>
2
+ <% if options[:git] -%>
3
3
  ARG BRANCH=master
4
4
  ARG REPO_URL
5
- <% end %>
5
+ <% end -%>
6
6
 
7
- ADD http://timejson.herokuapp.com build-time
8
7
  ADD ops/webapp.conf /etc/nginx/sites-enabled/webapp.conf
9
8
  ADD ops/env.conf /etc/nginx/main.d/env.conf
10
9
 
11
- <% if options[:git] %>
10
+ <% if options[:git] -%>
12
11
  RUN /sbin/setuser app bash -l -c "set -x && \
13
12
  git fetch -ap && \
14
13
  git reset --hard && \
@@ -18,14 +17,15 @@ RUN /sbin/setuser app bash -l -c "set -x && \
18
17
  bundle exec rake assets:clobber assets:precompile DATABASE_ADAPTER=nulldb && \
19
18
  mv /home/app/webapp/public/assets /home/app/webapp/public/assets-new && \
20
19
  mv /home/app/webapp/public/packs /home/app/webapp/public/packs-new"
21
- <% else %>
20
+ <% else -%>
21
+ RUN gem install bundler -v CHANGEME # Add the BUNDLED WITH version listed at the bottom of the Gemfile.lock
22
22
  COPY --chown=app . $APP_HOME
23
23
  RUN /sbin/setuser app bash -l -c "set -x && \
24
24
  (bundle check || bundle install) && \
25
25
  bundle exec rake assets:clobber assets:precompile DATABASE_ADAPTER=nulldb && \
26
26
  mv /home/app/webapp/public/assets /home/app/webapp/public/assets-new && \
27
27
  mv /home/app/webapp/public/packs /home/app/webapp/public/packs-new"
28
- <% end %>
28
+ <% end -%>
29
29
 
30
30
  RUN bash -l -c "set -x && \
31
31
  rm -f /etc/service/nginx/down"
@@ -97,24 +97,16 @@ services:
97
97
  - "8080"
98
98
  <% end -%>
99
99
 
100
- base:
101
- image: "${REGISTRY_HOST}${REGISTRY_URI}/base:latest"
102
- build:
103
- context: .
104
- dockerfile: Dockerfile.base
105
- args:
106
- DEPLOY_KEY: "${DEPLOY_KEY}"
107
- APP_NAME: "${APP_NAME}"
108
- REPO_URL: "${REPO_URL}"
109
- env_file:
110
- - .env
111
- - .env.development
112
-
113
100
  app:
114
101
  build:
115
- context: ..
102
+ <% if @sc_dir -%>
103
+ context: ..
116
104
  dockerfile: stack_car/Dockerfile
117
- args:
105
+ <% else -%>
106
+ context: .
107
+ dockerfile: Dockerfile
108
+ <% end -%>
109
+ args:
118
110
  DEPLOY_KEY: "${DEPLOY_KEY}"
119
111
  REPO_URL: "${REPO_URL}"
120
112
  BRANCH: "${BRANCH}"
@@ -133,8 +125,7 @@ services:
133
125
  tty: true
134
126
 
135
127
  web:
136
- extends:
137
- app:
128
+ extends: app
138
129
  ports:
139
130
  - "${WEB_PORT}"
140
131
  environment:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stack_car
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Kaufman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-26 00:00:00.000000000 Z
11
+ date: 2021-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -169,7 +169,6 @@ files:
169
169
  - templates/.env.development.erb
170
170
  - templates/.env.erb
171
171
  - templates/.gitlab-ci.yml.erb
172
- - templates/Dockerfile.base.erb
173
172
  - templates/Dockerfile.builder.erb
174
173
  - templates/Dockerfile.erb
175
174
  - templates/README.md
@@ -1,57 +0,0 @@
1
- FROM phusion/passenger-ruby26:1.0.9
2
- ARG DEPLOY_KEY
3
- <% if options[:git] %>
4
- ARG REPO_URL
5
- <% end %>
6
-
7
- RUN <%= pre_apt_string %> && \
8
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
9
- apt-get update -qq && \
10
- apt-get install -y \
11
- build-essential \
12
- libsasl2-dev \
13
- nodejs \
14
- pv \
15
- tzdata \
16
- <%= apt_packages_string %> && \
17
- apt-get clean && \
18
- rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
19
- <%= post_apt_string %>
20
-
21
- <% if options[:fcrepo] %>
22
- RUN mkdir -p /opt/fits && \
23
- curl -fSL -o /opt/fits/fits-latest.zip https://projects.iq.harvard.edu/files/fits/files/fits-1.3.0.zip && \
24
- cd /opt/fits && unzip fits-latest.zip && chmod +X /opt/fits/fits.sh
25
- <% end -%>
26
-
27
- RUN rm /etc/nginx/sites-enabled/default
28
- COPY ops/webapp.conf /etc/nginx/sites-enabled/webapp.conf
29
- COPY ops/env.conf /etc/nginx/main.d/env.conf
30
-
31
- ENV APP_HOME /home/app/webapp
32
- RUN mkdir $APP_HOME
33
- WORKDIR $APP_HOME
34
-
35
- ENV BUNDLE_GEMFILE=$APP_HOME/Gemfile \
36
- BUNDLE_JOBS=4
37
-
38
- COPY --chown=app Gemfile* $APP_HOME/
39
- RUN /sbin/setuser app bash -l -c "gem update bundler && (bundle check || bundle install)"
40
-
41
- <% if options[:git] %>
42
- RUN chown -R app $APP_HOME && /sbin/setuser app bash -l -c "git clone --depth 2 ${REPO_URL} ${APP_HOME}""
43
- <% else %>
44
- COPY --chown=app . $APP_HOME
45
- <% end %>
46
-
47
- <% if options[:imagemagick] %>
48
- # reenables pdfs in imagemagick see https://ubuntuforums.org/showthread.php?t=2403266
49
- RUN sed -i '/PDF/s/none/read|write/' /etc/ImageMagick-6/policy.xml
50
- <% end %>
51
-
52
- # this is so that these items are cached and only have to be updated
53
- RUN /sbin/setuser app /bin/bash -l -c 'cd /home/app/webapp && DATABASE_ADAPTER=nulldb bundle exec rake assets:precompile'
54
- # Asset complie and migrate if prod, otherwise just start nginx
55
- ADD ops/nginx.sh /etc/service/nginx/run
56
- RUN chmod +x /etc/service/nginx/run
57
- RUN rm -f /etc/service/nginx/down