Skip to content

Commit

Permalink
Usean extra spec similar to the ubi8 variant
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed Sep 29, 2021
1 parent f902af5 commit 093a855
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
22 changes: 16 additions & 6 deletions dev-tools/packaging/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,16 @@ shared:
from: 'arm64v8/centos:7'
buildFrom: 'arm64v8/centos:7'

- &cloud_agent_docker_spec
<<: *agent_docker_spec
extra_vars:
image_name: '{{.BeatName}}-cloud'

- &cloud_agent_docker_arm_spec
<<: *agent_docker_arm_spec
extra_vars:
image_name: '{{.BeatName}}-cloud'

# Deb/RPM spec for community beats.
- &deb_rpm_spec
<<: *common
Expand Down Expand Up @@ -998,12 +1008,12 @@ specs:
types: [docker]
spec:
<<: *agent_docker_spec
<<: *cloud_agent_docker_spec
<<: *elastic_docker_spec
<<: *elastic_license_for_binaries
# This image gets a 'complete' variant for synthetics and other large
# packages too big to fit in the main image. In addition, the 'cloud'
# variant for the specific cloud requirements.
variants: ["complete", "cloud"]
# packages too big to fit in the main image.
variants: ["complete"]
files:
'{{.BeatName}}{{.BinaryExt}}':
source: ./build/golang-crossbuild/{{.BeatName}}-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}}
Expand All @@ -1025,12 +1035,12 @@ specs:
types: [docker]
spec:
<<: *agent_docker_arm_spec
<<: *cloud_agent_docker_arm_spec
<<: *elastic_docker_spec
<<: *elastic_license_for_binaries
# This image gets a 'complete' variant for synthetics and other large
# packages too big to fit in the main image. In addition, the 'cloud'
# variant for the specific cloud requirements.
variants: ["complete", "cloud"]
# packages too big to fit in the main image.
variants: ["complete"]
files:
'{{.BeatName}}{{.BinaryExt}}':
source: ./build/golang-crossbuild/{{.BeatName}}-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RUN mkdir -p {{ $beatHome }}/data {{ $beatHome }}/data/elastic-agent-{{ commit_s
{{- range $i, $modulesd := .ModulesDirs }}
chmod 0775 {{ $beatHome}}/{{ $modulesd }} && \
{{- end }}
{{- if (and (eq .Variant "cloud") (not (contains .from "ubi-minimal"))) }}
{{- if contains .from "-cloud" }}
tar -xvf {{ $beatHome }}/data/elastic-agent-*/downloads/metricbeat-*.tar.gz --strip-components 1 --directory /opt --wildcards "*metricbeat" --directory && \
tar -xvf {{ $beatHome }}/data/elastic-agent-*/downloads/filebeat-*.tar.gz --strip-components 1 --directory /opt --wildcards "*filebeat" --directory && \
{{- end }}
Expand Down Expand Up @@ -138,7 +138,7 @@ RUN mkdir /licenses
COPY --from=home {{ $beatHome }}/LICENSE.txt /licenses
COPY --from=home {{ $beatHome }}/NOTICE.txt /licenses

{{- if (and (eq .Variant "cloud") (not (contains .from "ubi-minimal"))) }}
{{- if contains .from "-cloud" }}
COPY --from=home /opt/filebeat /opt/filebeat
COPY --from=home /opt/metricbeat /opt/metricbeat
{{- end }}
Expand Down

0 comments on commit 093a855

Please sign in to comment.