-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It may be useful for launcher2 build to bake in some env, allowing for default env to run from a built image. Introduce defaultBakeEnv as a list of env to bake into images. This allows for folks pulling images to not need to mark every env variable, allowing for some convenience in starting images.
- Loading branch information
1 parent
9835070
commit 8546d96
Showing
2 changed files
with
113 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,11 +37,95 @@ var _ = Describe("Config", func() { | |
Expect(string(out[:])).To(ContainSubstring("DISCOURSE_DEVELOPER_EMAILS: '[email protected],[email protected]'")) | ||
}) | ||
|
||
It("can convert pups config to dockerfile format", func() { | ||
It("can convert pups config to dockerfile format and bake in default env", func() { | ||
dockerfile := conf.Dockerfile("", false) | ||
Expect(dockerfile).To(ContainSubstring("ARG DISCOURSE_DEVELOPER_EMAILS")) | ||
Expect(dockerfile).To(ContainSubstring("RUN cat /temp-config.yaml")) | ||
Expect(dockerfile).To(ContainSubstring("EXPOSE 80")) | ||
Expect(dockerfile).To(ContainSubstring(`FROM ${dockerfile_from_image} | ||
ARG DISCOURSE_DB_HOST | ||
ARG DISCOURSE_DB_PASSWORD | ||
ARG DISCOURSE_DB_PORT | ||
ARG DISCOURSE_DB_SOCKET | ||
ARG DISCOURSE_DEVELOPER_EMAILS | ||
ARG DISCOURSE_HOSTNAME | ||
ARG DISCOURSE_REDIS_HOST | ||
ARG DISCOURSE_SMTP_ADDRESS | ||
ARG DISCOURSE_SMTP_PASSWORD | ||
ARG DISCOURSE_SMTP_USER_NAME | ||
ARG LANG | ||
ARG LANGUAGE | ||
ARG LC_ALL | ||
ARG MULTI | ||
ARG RAILS_ENV | ||
ARG REPLACED | ||
ARG RUBY_GC_HEAP_GROWTH_MAX_SLOTS | ||
ARG RUBY_GC_HEAP_INIT_SLOTS | ||
ARG RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR | ||
ARG UNICORN_SIDEKIQS | ||
ARG UNICORN_WORKERS | ||
ENV RAILS_ENV=${RAILS_ENV} | ||
ENV RUBY_GC_HEAP_GROWTH_MAX_SLOTS=${RUBY_GC_HEAP_GROWTH_MAX_SLOTS} | ||
ENV RUBY_GC_HEAP_INIT_SLOTS=${RUBY_GC_HEAP_INIT_SLOTS} | ||
ENV RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=${RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR} | ||
ENV UNICORN_SIDEKIQS=${UNICORN_SIDEKIQS} | ||
ENV UNICORN_WORKERS=${UNICORN_WORKERS} | ||
EXPOSE 443 | ||
EXPOSE 80 | ||
EXPOSE 90 | ||
COPY config.yaml /temp-config.yaml | ||
RUN cat /temp-config.yaml | /usr/local/bin/pups --stdin && rm /temp-config.yaml | ||
CMD ["/sbin/boot"]`)) | ||
}) | ||
|
||
It("can generate a dockerfile with all env baked into the image", func() { | ||
dockerfile := conf.Dockerfile("", true) | ||
Expect(dockerfile).To(ContainSubstring(`FROM ${dockerfile_from_image} | ||
ARG DISCOURSE_DB_HOST | ||
ARG DISCOURSE_DB_PASSWORD | ||
ARG DISCOURSE_DB_PORT | ||
ARG DISCOURSE_DB_SOCKET | ||
ARG DISCOURSE_DEVELOPER_EMAILS | ||
ARG DISCOURSE_HOSTNAME | ||
ARG DISCOURSE_REDIS_HOST | ||
ARG DISCOURSE_SMTP_ADDRESS | ||
ARG DISCOURSE_SMTP_PASSWORD | ||
ARG DISCOURSE_SMTP_USER_NAME | ||
ARG LANG | ||
ARG LANGUAGE | ||
ARG LC_ALL | ||
ARG MULTI | ||
ARG RAILS_ENV | ||
ARG REPLACED | ||
ARG RUBY_GC_HEAP_GROWTH_MAX_SLOTS | ||
ARG RUBY_GC_HEAP_INIT_SLOTS | ||
ARG RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR | ||
ARG UNICORN_SIDEKIQS | ||
ARG UNICORN_WORKERS | ||
ENV DISCOURSE_DB_HOST=${DISCOURSE_DB_HOST} | ||
ENV DISCOURSE_DB_PASSWORD=${DISCOURSE_DB_PASSWORD} | ||
ENV DISCOURSE_DB_PORT=${DISCOURSE_DB_PORT} | ||
ENV DISCOURSE_DB_SOCKET=${DISCOURSE_DB_SOCKET} | ||
ENV DISCOURSE_DEVELOPER_EMAILS=${DISCOURSE_DEVELOPER_EMAILS} | ||
ENV DISCOURSE_HOSTNAME=${DISCOURSE_HOSTNAME} | ||
ENV DISCOURSE_REDIS_HOST=${DISCOURSE_REDIS_HOST} | ||
ENV DISCOURSE_SMTP_ADDRESS=${DISCOURSE_SMTP_ADDRESS} | ||
ENV DISCOURSE_SMTP_PASSWORD=${DISCOURSE_SMTP_PASSWORD} | ||
ENV DISCOURSE_SMTP_USER_NAME=${DISCOURSE_SMTP_USER_NAME} | ||
ENV LANG=${LANG} | ||
ENV LANGUAGE=${LANGUAGE} | ||
ENV LC_ALL=${LC_ALL} | ||
ENV MULTI=${MULTI} | ||
ENV RAILS_ENV=${RAILS_ENV} | ||
ENV REPLACED=${REPLACED} | ||
ENV RUBY_GC_HEAP_GROWTH_MAX_SLOTS=${RUBY_GC_HEAP_GROWTH_MAX_SLOTS} | ||
ENV RUBY_GC_HEAP_INIT_SLOTS=${RUBY_GC_HEAP_INIT_SLOTS} | ||
ENV RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=${RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR} | ||
ENV UNICORN_SIDEKIQS=${UNICORN_SIDEKIQS} | ||
ENV UNICORN_WORKERS=${UNICORN_WORKERS} | ||
EXPOSE 443 | ||
EXPOSE 80 | ||
EXPOSE 90 | ||
COPY config.yaml /temp-config.yaml | ||
RUN cat /temp-config.yaml | /usr/local/bin/pups --stdin && rm /temp-config.yaml | ||
CMD ["/sbin/boot"]`)) | ||
}) | ||
|
||
Context("hostname tests", func() { | ||
|