Skip to content

Commit

Permalink
Update deployment config and scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Brandon Sprague <[email protected]>
  • Loading branch information
bcspragu committed Oct 4, 2023
1 parent e9625eb commit e611b5a
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
with:
disableTelemetry: true
containerAppName: pactasrv-dev
containerAppEnvironment: pactasrv-dev
containerAppEnvironment: pacta-dev
resourceGroup: rmi-pacta-dev
imageToDeploy: rmipacta.azurecr.io/pacta:dev
location: centalus
Expand Down
1 change: 1 addition & 0 deletions azure/aztask/aztask.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ func (r *Runner) StartRun(ctx context.Context, req *task.StartRunRequest) (task.
Value: to.Ptr(string(req.PortfolioID)),
},
},
// TODO: Take in the image digest as part of the task definition, as this can change per request.
Image: to.Ptr(r.cfg.Image.WithTag("latest")),
Name: to.Ptr(name),
Probes: []*armappcontainers.ContainerAppProbe{},
Expand Down
10 changes: 10 additions & 0 deletions cmd/server/configs/local.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@ secret_postgres_password UNUSED
# In non-local environments, these are passed in by Azure's secret handling infra
secret_auth_public_key_id 2023-08-11
secret_auth_public_key_data -----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAP/Sv7H5TRozqXeQ2zV9W4V6Zkb/U5XWEjCQbOwAl0nc=\n-----END PUBLIC KEY-----

secret_runner_config_location centralus
secret_runner_config_config_path /configs/local.conf
secret_runner_config_identity_name pacta-runner-local
secret_runner_config_identity_subscription_id 69b6db12-37e3-4e1f-b48c-aa41dba612a9
secret_runner_config_identity_resource_group rmi-pacta-local
secret_runner_config_identity_client_id c02b7346-6ba6-438a-8136-1ccb608e5449
secret_runner_config_identity_managed_environment pacta-local
secret_runner_config_image_registry rmipacta.azurecr.io
secret_runner_config_image_name runner
32 changes: 31 additions & 1 deletion scripts/run_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,36 @@ set -euo pipefail
ROOT="$BUILD_WORKSPACE_DIRECTORY"
cd "$ROOT"

# We keep it around because we'll need it at some point, but it can't be empty.
VALID_FLAGS=(
"unused"
)

VALID_FLAGS_NO_ARGS=(
"use_azure_runner"
)

# This argument-parsing monstrosity brought to you by some random GitHub Gist:
# https://gist.github.com/magnetikonline/22c1eb412daa350eeceee76c97519da8
OPTS=$(getopt \
--longoptions "$(printf "%s:," "${VALID_FLAGS[@]}")" \
--longoptions "$(printf "%s," "${VALID_FLAGS_NO_ARGS[@]}")" \
--name "$(basename "$0")" \
--options "" \
-- "$@"
)

eval set --$OPTS
declare -a FLAGS=()
while [ ! $# -eq 0 ]
do
case "$1" in
--use_azure_runner)
FLAGS+=("--use_azure_runner")
;;
esac
shift
done

PG_LOCAL_DATA="$ROOT/.postgres-data"
PG_PROPS_FILE="$PG_LOCAL_DATA/db.properties"
Expand All @@ -18,7 +48,7 @@ LOCAL_DSN+=" host=$(get_val "SOCKET_DIR")"
LOCAL_DSN+=" dbname=$(get_val "PG_DB_NAME")"
LOCAL_DSN+=" sslmode=disable"

declare -a FLAGS=(
FLAGS+=(
"--config=${ROOT}/cmd/server/configs/local.conf"
"--local_dsn=${LOCAL_DSN}"
)
Expand Down

0 comments on commit e611b5a

Please sign in to comment.