-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
53 additions
and
6 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 |
---|---|---|
@@ -1,12 +1,47 @@ | ||
# QiiCipher のコマンドだけを含めた Alpine イメージです | ||
# ============================================================================= | ||
# QiiCipher for Docker | ||
# ============================================================================= | ||
# QiiCipher のコマンドだけを含めた Alpine イメージです。 | ||
# マルチステージ・ビルドでテストを実行し、成功した場合のみ QiiCipher のコマンドだけを含めた | ||
# シンプルなイメージを作成します。docker-compose.test.yml により Docker Hub からのダウ | ||
# ンロード(`docker pull`)が可能になります。 | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Test Stage | ||
# ----------------------------------------------------------------------------- | ||
FROM shellspec/shellspec:latest AS testbuild | ||
|
||
# Install miminum requirements for QiiCipher | ||
RUN apk add --no-cache \ | ||
openssl \ | ||
openssh \ | ||
ca-certificates && update-ca-certificates | ||
|
||
# Install requirements for testing | ||
RUN apk add --no-cache \ | ||
git \ | ||
shellcheck \ | ||
shfmt | ||
|
||
# Copy the hole repo | ||
COPY . /app | ||
WORKDIR /app | ||
|
||
# Run tests | ||
RUN \ | ||
/app/.github/run-lint.sh \ | ||
&& /app/.github/run-test.sh | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Final Stage | ||
# ----------------------------------------------------------------------------- | ||
FROM alpine | ||
|
||
RUN apk add --no-cache \ | ||
bash \ | ||
curl \ | ||
openssl \ | ||
openssh \ | ||
ca-certificates && update-ca-certificates | ||
|
||
COPY ./bin /usr/local/sbin | ||
COPY --from=testbuild /app/bin /usr/local/sbin | ||
|
||
CMD ["/bin/ls","/bin/local/sbin"] | ||
CMD ["/bin/ls","/usr/local/sbin"] |
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,8 @@ | ||
# Test for Docker Cloud Automated Build | ||
sut: | ||
build: . | ||
volumes: | ||
# Mount test file | ||
- ./run-test_docker-cloud.sh:/app/run-test.sh | ||
# Run the mounted test file inside a container from the built image | ||
entrypoint: enc --help |