-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] Actually publish verification-client (#64)
- Loading branch information
Showing
5 changed files
with
100 additions
and
57 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
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,40 +1,46 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
set -euxo pipefail | ||
cd "$(dirname "${BASH_SOURCE[0]}" )"/.. | ||
|
||
case $(uname -s) in | ||
Darwin*) echo "docker images can only be built on linux (ie on CircleCI)" && exit 1 ;; | ||
esac | ||
|
||
VERSION=$(git describe --tags --always --first-parent) | ||
DEST=build/docker-context | ||
rm -rf $DEST | ||
mkdir -p $DEST | ||
|
||
cp ./verification-server/Dockerfile $DEST/Dockerfile | ||
|
||
BINARY=./target/release/conjure-verification-server | ||
if [ ! -f $BINARY ]; then | ||
echo "$BINARY must exist - run 'cargo build --release' to create it" | ||
exit 1 | ||
fi | ||
cp $BINARY $DEST | ||
|
||
TEST_CASES=./verification-server-api/build/test-cases.json | ||
if [ ! -f $TEST_CASES ]; then | ||
echo "$TEST_CASES file must exist - run './gradlew compileTestCasesJson' to create it" | ||
exit 1 | ||
fi | ||
cp $TEST_CASES $DEST | ||
|
||
IR_FILE=./verification-server-api/build/conjure-ir/verification-server-api.conjure.json | ||
if [ ! -f $IR_FILE ]; then | ||
echo "$IR_FILE file must exist - run './gradlew compileIr' to create it" | ||
exit 1 | ||
fi | ||
cp $IR_FILE $DEST | ||
|
||
cd $DEST | ||
docker build -t "palantirtechnologies/conjure-verification-server:$VERSION" . | ||
|
||
docker tag "palantirtechnologies/conjure-verification-server:$VERSION" "palantirtechnologies/conjure-verification-server:latest" | ||
|
||
function build_docker() ( | ||
DEST="build/$1/docker-context" | ||
rm -rf "$DEST" | ||
mkdir -p "$DEST" | ||
|
||
cp "./verification-$1/Dockerfile" "$DEST/Dockerfile" | ||
|
||
BINARY="./target/release/conjure-verification-$1" | ||
if [ ! -f "$BINARY" ]; then | ||
echo "$BINARY must exist - run 'cargo build --release' to create it" | ||
exit 1 | ||
fi | ||
cp "$BINARY" "$DEST" | ||
|
||
TEST_CASES=./verification-$1-api/build/test-cases.json | ||
if [ ! -f "$TEST_CASES" ]; then | ||
echo "$TEST_CASES file must exist - run './gradlew compileTestCasesJson' to create it" | ||
exit 1 | ||
fi | ||
cp "$TEST_CASES" "$DEST" | ||
|
||
IR_FILE="./verification-$1-api/build/conjure-ir/verification-$1-api.conjure.json" | ||
if [ ! -f "$IR_FILE" ]; then | ||
echo "$IR_FILE file must exist - run './gradlew compileIr' to create it" | ||
exit 1 | ||
fi | ||
cp "$IR_FILE" "$DEST" | ||
|
||
cd "$DEST" | ||
docker build -t "palantirtechnologies/conjure-verification-$1:$VERSION" . | ||
|
||
docker tag "palantirtechnologies/conjure-verification-$1:$VERSION" "palantirtechnologies/conjure-verification-$1:latest" | ||
) | ||
|
||
build_docker "server" | ||
build_docker "client" |
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,23 @@ | ||
FROM rust:1.29.0-stretch | ||
|
||
RUN set -eux; \ | ||
apt-get update; \ | ||
apt-get install -y --no-install-recommends dumb-init; \ | ||
rm -rf /var/lib/apt/lists/*; \ | ||
mkdir -p /opt/palantir/services/conjure-verification-client/service/bin; \ | ||
mkdir -p /opt/palantir/services/conjure-verification-client/var/conf | ||
|
||
ADD conjure-verification-client /opt/palantir/services/conjure-verification-client/service/bin | ||
ADD test-cases.json /opt/palantir/services/conjure-verification-client/var/conf | ||
ADD verification-client-api.conjure.json /opt/palantir/services/conjure-verification-client/var/conf | ||
|
||
RUN chmod +x /opt/palantir/services/conjure-verification-client/service/bin/conjure-verification-client | ||
|
||
EXPOSE 8000 | ||
|
||
ENV RUST_LOG conjure_verification_client=info,conjure_verification_http=info | ||
|
||
WORKDIR /opt/palantir/services/conjure-verification-client | ||
|
||
ENTRYPOINT ["dumb-init", "--", "service/bin/conjure-verification-client"] | ||
CMD ["var/conf/test-cases.json", "var/conf/verification-client-api.conjure.json"] |
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,4 +1,4 @@ | ||
FROM debian:stretch-slim | ||
FROM rust:1.29.0-stretch | ||
|
||
RUN set -eux; \ | ||
apt-get update; \ | ||
|