forked from arjungautam1/fullstack-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from paul-gilber/container-structure-test
Container structure test
- Loading branch information
Showing
6 changed files
with
106 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,9 @@ | ||
FROM alpine:3.18 | ||
|
||
# Get VERSION from: https://github.com/GoogleContainerTools/container-structure-test/releases | ||
ARG VERSION=latest | ||
|
||
RUN apk add --no-cache curl | ||
|
||
# Get command from: https://github.com/GoogleContainerTools/container-structure-test#linux | ||
RUN curl -LO https://storage.googleapis.com/container-structure-test/${VERSION}/container-structure-test-linux-amd64 && chmod +x container-structure-test-linux-amd64 && mv container-structure-test-linux-amd64 /usr/local/bin/container-structure-test |
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,25 @@ | ||
--- | ||
name: Container Structure Tests | ||
description: | | ||
Container Structure Tests provide a powerful framework to validate the structure of a container image. | ||
These tests can be used to check the output of commands in an image, as well as verify metadata and contents of the filesystem. | ||
See https://github.com/GoogleContainerTools/container-structure-test | ||
Note: This action does not pull remote images | ||
inputs: | ||
image: | ||
description: Container Image to test | ||
required: true | ||
configFile: | ||
description: Path to Container Structure Test Configuration File | ||
required: false | ||
default: default-container-structure-test.yaml | ||
runs: | ||
using: docker | ||
image: Dockerfile | ||
args: | ||
- container-structure-test | ||
- test | ||
- --image | ||
- ${{ inputs.image }} | ||
- --config | ||
- ${{ inputs.configFile }} |
15 changes: 15 additions & 0 deletions
15
.github/actions/container-structure-test/default-container-structure-test.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
# Run command: | ||
# > container-structure-test test --image demoapp-backend --config container-structure-test.yaml | ||
schemaVersion: 2.0.0 | ||
|
||
metadataTest: | ||
user: '' | ||
|
||
fileExistenceTests: | ||
- name: Check Container structure test is installed | ||
path: /usr/local/bin/container-structure-test | ||
shouldExist: true | ||
permissions: -rwxr-xr-x | ||
uid: 0 | ||
gid: 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
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