-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release and Debug image release pipeline (#214)
This appends to the release `cloudbuild.yaml` to create a release and debug tagged image when run based on the `distroless` image. This also includes several steps that are needed for ongoing internal compliance - such as maintaining a list of dependencies and their licences, zipping MPL licenced code, etc. Fixes #201
- Loading branch information
1 parent
583bf9a
commit 28b34c0
Showing
12 changed files
with
289 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# Copyright 2021 Google LLC All Rights Reserved. | ||
# | ||
# 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. | ||
# | ||
|
||
.* | ||
target/*/deps | ||
target/*/incremental | ||
target/*/build |
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 |
---|---|---|
|
@@ -15,4 +15,5 @@ | |
# | ||
|
||
.* | ||
!.dockerignore | ||
target |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# | ||
# Copyright 2021 Google LLC All Rights Reserved. | ||
# | ||
# 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. | ||
# | ||
|
||
accepted = [ | ||
"Apache-2.0", | ||
"BSD-2-Clause", | ||
"BSD-3-Clause", | ||
"CC0-1.0", | ||
"MIT", | ||
"MPL-2.0", | ||
] |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright 2021 Google LLC All Rights Reserved. | ||
# | ||
# 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. | ||
|
||
ARG PROFILE | ||
|
||
FROM gcr.io/distroless/cc:nonroot as base | ||
WORKDIR / | ||
COPY ./license.html . | ||
COPY ./dependencies-src.zip . | ||
COPY --chown=nonroot:nonroot ./build/release/quilkin.yaml /etc/quilkin/quilkin.yaml | ||
|
||
FROM base as release | ||
COPY ./target/x86_64-unknown-linux-gnu/release/quilkin . | ||
|
||
FROM base as debug | ||
COPY ./target/x86_64-unknown-linux-gnu/debug/quilkin . | ||
|
||
FROM $PROFILE | ||
USER nonroot:nonroot | ||
ENTRYPOINT ["/quilkin", "--filename", "/etc/quilkin/quilkin.yaml"] |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bash | ||
|
||
# | ||
# Copyright 2021 Google LLC All Rights Reserved. | ||
# | ||
# 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. | ||
# | ||
|
||
set -eo pipefail | ||
|
||
CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}" | ||
|
||
# Need to grabs source for MPL, GPL, LGPL, and CDDL licenced dependencies | ||
# and include it in the Docker image | ||
|
||
# This should be reviewed before each release to make sure we're capturing all | ||
# the dependencies we need. | ||
|
||
rm dependencies-src.zip || true | ||
|
||
dependencies=("slog-json") | ||
|
||
zip="$(pwd)/dependencies-src.zip" | ||
pushd "$CARGO_HOME/registry/src" | ||
for d in "${dependencies[@]}"; do | ||
path=$(find . -type d -name "$d-*") | ||
echo "Archiving $d:$path" | ||
zip -rv "$zip" "$path" | ||
done | ||
popd |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# | ||
# Copyright 2021 Google LLC All Rights Reserved. | ||
# | ||
# 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. | ||
# | ||
|
||
version: v1alpha1 | ||
static: | ||
endpoints: | ||
- name: noop | ||
address: 127.0.0.1:0 |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{{! | ||
Copyright 2021 Google LLC All Rights Reserved. | ||
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. | ||
}}"External Library Name","Link to License","License Name" | ||
{{#each licenses}}{{#each used_by}}"{{crate.name}}","{{crate.repository}}","{{../name}}" | ||
{{/each}}{{/each}} |
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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<!-- | ||
Copyright 2021 Google LLC All Rights Reserved. | ||
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. | ||
--> | ||
|
||
<html> | ||
|
||
<head> | ||
<style> | ||
@media (prefers-color-scheme: dark) { | ||
body { | ||
background: #333; | ||
color: white; | ||
} | ||
a { | ||
color: skyblue; | ||
} | ||
} | ||
.container { | ||
font-family: sans-serif; | ||
max-width: 800px; | ||
margin: 0 auto; | ||
} | ||
.intro { | ||
text-align: center; | ||
} | ||
.licenses-list { | ||
list-style-type: none; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
.license-used-by { | ||
margin-top: -10px; | ||
} | ||
.license-text { | ||
max-height: 200px; | ||
overflow-y: scroll; | ||
white-space: pre-wrap; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<main class="container"> | ||
<div class="intro"> | ||
<h1>Third Party Licenses</h1> | ||
<p>This page lists the licenses of the projects used in cargo-about.</p> | ||
</div> | ||
|
||
<h2>Overview of licenses:</h2> | ||
<ul class="licenses-overview"> | ||
{{#each overview}} | ||
<li><a href="#{{id}}">{{name}}</a> ({{count}})</li> | ||
{{/each}} | ||
</ul> | ||
|
||
<h2>All license text:</h2> | ||
<ul class="licenses-list"> | ||
{{#each licenses}} | ||
<li class="license"> | ||
<h3 id="{{id}}">{{name}}</h3> | ||
<h4>Used by:</h4> | ||
<ul class="license-used-by"> | ||
{{#each used_by}} | ||
<li><a href="{{#if crate.repository}} {{crate.repository}} {{else}} https://crates.io/crates/{{crate.name}} {{/if}}">{{crate.name}} {{crate.version}}</a></li> | ||
{{/each}} | ||
</ul> | ||
<pre class="license-text">{{text}}</pre> | ||
</li> | ||
{{/each}} | ||
</ul> | ||
</main> | ||
</body> | ||
|
||
</html> |