Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Commit

Permalink
Fix missing assets for redirect service (#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo authored Sep 18, 2020
1 parent c8d16d7 commit f53ba9a
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 5 deletions.
6 changes: 2 additions & 4 deletions builders/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,8 @@ steps:
name: 'docker:19'
args:
- 'build'
- '--file=builders/service.dockerfile'
- '--file=builders/enx-redirect.dockerfile'
- '--tag=gcr.io/${PROJECT_ID}/${_REPO}/enx-redirect:${_TAG}'
- '--build-arg=SERVICE=enx-redirect'
- '.'
waitFor:
- 'build-enx-redirect'
Expand Down Expand Up @@ -263,9 +262,8 @@ steps:
name: 'docker:19'
args:
- 'build'
- '--file=builders/service.dockerfile'
- '--file=builders/server.dockerfile'
- '--tag=gcr.io/${PROJECT_ID}/${_REPO}/server:${_TAG}'
- '--build-arg=SERVICE=server'
- '.'
waitFor:
- 'build-server'
Expand Down
24 changes: 24 additions & 0 deletions builders/enx-redirect.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM alpine AS builder

FROM scratch
ARG SERVICE
COPY ./bin/enx-redirect /server
COPY ./cmd/enx-redirect/assets /assets
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

ENV PORT 8080
ENTRYPOINT ["/server"]
23 changes: 23 additions & 0 deletions builders/server.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM alpine AS builder

FROM scratch
COPY ./bin/server /server
COPY ./cmd/server/assets /assets
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

ENV PORT 8080
ENTRYPOINT ["/server"]
1 change: 0 additions & 1 deletion builders/service.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ FROM alpine AS builder
FROM scratch
ARG SERVICE
COPY ./bin/${SERVICE} /server
COPY ./cmd/server/assets /assets
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

ENV PORT 8080
Expand Down
1 change: 1 addition & 0 deletions terraform/services.tf
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ locals {
}

redirect_config = {
ASSETS_PATH = "/assets"
HOSTNAME_TO_REGION = join(",", [for o in var.redirect_domain_map : format("%s=%s", o.host, o.region)])
}
}
Expand Down

0 comments on commit f53ba9a

Please sign in to comment.