boxing 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -0
- data/lib/boxing/context.rb +31 -5
- data/lib/boxing/version.rb +1 -1
- data/templates/Dockerfile.tt +4 -4
- data/templates/dockerignore.tt +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 747c1ce612416684731778d49c0b85eaf1630d01a305c9a96494e5828d7c0cbc
|
4
|
+
data.tar.gz: fe4025de518fce98279332c9dd5565294966d6b55e6a5bd60bcb09da5672bd8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 075d91ba4af2033ca7f2f55d7d3414dbc9b718f882e6531ed854609469a268ca85c13898c3c5c3e571c4039f0a00b3828a54c6493d5717a59cb30312111317b5
|
7
|
+
data.tar.gz: 15a7c46db72f0c0e481bfbd6af6abecd69e8ac077b3f66bf971a7c98cbb7e33d33b5f87378b3afeb8126f8d00ab0d80a961b49098c6a161884126f5573e8e28e
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/boxing/context.rb
CHANGED
@@ -20,11 +20,14 @@ module Boxing
|
|
20
20
|
#
|
21
21
|
# @since 0.1.0
|
22
22
|
def packages
|
23
|
-
@packages ||=
|
24
|
-
|
25
|
-
.
|
26
|
-
.
|
27
|
-
|
23
|
+
@packages ||=
|
24
|
+
Set
|
25
|
+
.new(default_packages)
|
26
|
+
.merge(
|
27
|
+
@dependencies
|
28
|
+
.map(&:name)
|
29
|
+
.flat_map { |name| @database.package_for(name).to_a }
|
30
|
+
)
|
28
31
|
end
|
29
32
|
|
30
33
|
# Check rubygems exists
|
@@ -38,6 +41,29 @@ module Boxing
|
|
38
41
|
@dependencies.any? { |dep| names.include?(dep.name) }
|
39
42
|
end
|
40
43
|
|
44
|
+
# Does any gem from git
|
45
|
+
#
|
46
|
+
# @return [TrueClass|FalseClass]
|
47
|
+
#
|
48
|
+
# @since 0.4.0
|
49
|
+
def git?
|
50
|
+
pp @dependencies
|
51
|
+
@dependencies.any?(&:git)
|
52
|
+
end
|
53
|
+
|
54
|
+
# Default packages
|
55
|
+
#
|
56
|
+
# @return [Array<Boxing::Package>]
|
57
|
+
#
|
58
|
+
# @since 0.4.0
|
59
|
+
def default_packages
|
60
|
+
[
|
61
|
+
Package.new('build-base', mode: Package::BUILD)
|
62
|
+
]
|
63
|
+
.push(git? ? Package.new('git', mode: Package::BUILD) : nil)
|
64
|
+
.compact
|
65
|
+
end
|
66
|
+
|
41
67
|
# Convert to binding
|
42
68
|
#
|
43
69
|
# @return [Binding]
|
data/lib/boxing/version.rb
CHANGED
data/templates/Dockerfile.tt
CHANGED
@@ -4,7 +4,7 @@ ARG RUBY_VERSION=<%= RUBY_VERSION %>
|
|
4
4
|
FROM ruby:${RUBY_VERSION}-alpine AS gem
|
5
5
|
ARG APP_ROOT
|
6
6
|
|
7
|
-
RUN apk add --no-cache
|
7
|
+
RUN apk add --no-cache <%= packages.select(&:build?).join(' ') %>
|
8
8
|
|
9
9
|
RUN mkdir -p ${APP_ROOT}
|
10
10
|
COPY Gemfile Gemfile.lock ${APP_ROOT}/
|
@@ -29,9 +29,6 @@ ARG APP_ROOT
|
|
29
29
|
<%- if packages.select(&:runtime?).any? -%>
|
30
30
|
RUN apk add --no-cache <%= packages.select(&:runtime?).join(' ') %>
|
31
31
|
|
32
|
-
ARG REVISION
|
33
|
-
ENV REVISION $REVISION
|
34
|
-
|
35
32
|
<%- end -%>
|
36
33
|
COPY --from=gem /usr/local/bundle/config /usr/local/bundle/config
|
37
34
|
COPY --from=gem /usr/local/bundle /usr/local/bundle
|
@@ -46,6 +43,9 @@ ENV RAILS_LOG_TO_STDOUT=true
|
|
46
43
|
ENV APP_ROOT=$APP_ROOT
|
47
44
|
|
48
45
|
COPY . ${APP_ROOT}
|
46
|
+
|
47
|
+
ARG REVISION
|
48
|
+
ENV REVISION $REVISION
|
49
49
|
RUN echo $REVISION > ${SERVER_ROOT}/REVISION
|
50
50
|
|
51
51
|
# Apply Execute Permission
|
data/templates/dockerignore.tt
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boxing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 蒼時弦也
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|