Skip to content

Commit

Permalink
chore: adds vit-ss container and CI to build/publish it
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgilman committed Dec 8, 2023
1 parent d50b4c1 commit 5f45df5
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on:
push:

permissions:
id-token: write
contents: write
packages: write

jobs:
ci:
uses: input-output-hk/catalyst-ci/.github/workflows/ci.yml@master
with:
aws_ecr_registry: 332405224602.dkr.ecr.eu-central-1.amazonaws.com
aws_role_arn: arn:aws:iam::332405224602:role/ci
aws_region: eu-central-1
default_branch: catalyst-fund9-gold
secrets:
deployment_token: ${{ secrets.CI_BOT_TOKEN }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
earthly_runner_address: ${{ secrets.EARTHLY_SATELLITE_ADDRESS }}
earthly_runner_secret: ${{ secrets.EARTHLY_RUNNER_SECRET }}
20 changes: 20 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,23 @@ build:

SAVE ARTIFACT /src/target/release/vit-servicing-station-cli vit-servicing-station-cli
SAVE ARTIFACT /src/target/release/vit-servicing-station-server vit-servicing-station-server

publish:
FROM debian:stable-slim
WORKDIR /app

ARG tag=latest

RUN apt-get update && \
apt-get install -y --no-install-recommends \
libssl-dev \
libpq-dev \
libsqlite3-dev

COPY +build/vit-servicing-station-server .
COPY vit-servicing-station-server/entrypoint.sh .
RUN chmod +x entrypoint.sh

ENTRYPOINT ["/app/entrypoint.sh"]

SAVE IMAGE vit-servicing-station-server:${tag}
23 changes: 23 additions & 0 deletions vit-servicing-station-server/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/bash

echo ">>> Entering entrypoint script..."

# Verify the config exists
if [[ ! -f "$CONFIG_PATH" ]]; then
echo "ERROR: configuration file does not exist at: $CONFIG_PATH"
echo ">>> Aborting..."
exit 1
fi

# Allow overriding vit-servicing-station-server binary
BIN_PATH=${BIN_PATH:=/app/vit-servicing-station-server}

echo ">>> Using the following parameters:"
echo "Config file: $CONFIG_PATH"

args+=()
args+=("--in-settings-file" "$CONFIG_PATH")
args+=("--service-version" "$VERSION")

echo ">>> Running servicing station..."
exec "$BIN_PATH" "''${args[@]}"

0 comments on commit 5f45df5

Please sign in to comment.