-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 parent
d8d9f89
commit b853b8c
Showing
6 changed files
with
99 additions
and
9 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 |
---|---|---|
@@ -1,7 +1,43 @@ | ||
DEBUG= | ||
# Set the TMPDIR to be used | ||
TMPDIR="$TMPDIR" | ||
|
||
# Accessing AWS for testnet.polykey.io and mainnet.polykey.io deployment | ||
AWS_DEFAULT_REGION='ap-southeast-2' | ||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
|
||
# Container registry domain | ||
CONTAINER_REGISTRY='015248367786.dkr.ecr.ap-southeast-2.amazonaws.com' | ||
|
||
# Container repository | ||
CONTAINER_REPOSITORY="$CONTAINER_REGISTRY/polykey" | ||
|
||
# Accessing ECR for testnet.polykey.io and mainnet.polykey.io | ||
# Path to container registry authentication file used by `skopeo` | ||
# The file has the same contents as `DOCKER_AUTH_CONFIG` | ||
# Use this command to acquire the auth file at `./tmp/auth.json`: | ||
# ``` | ||
# aws ecr get-login-password --region ap-southeast-2 \ | ||
# | \ | ||
# skopeo login \ | ||
# --username AWS \ | ||
# --password-stdin \ | ||
# $CONTAINER_REPOSITORY \ | ||
# --authfile=./tmp/auth.json | ||
# ``` | ||
# REGISTRY_AUTH_FILE= | ||
|
||
# Unused atm (jest sets this to `test`) | ||
NODE_ENV=development | ||
TMPDIR=$TMPDIR | ||
#To allow testing different executables in the bin tests | ||
#PK_TEST_DOCKER_IMAGE=$image #Specify the docker image that the `docker-run.sh` uses | ||
#PK_TEST_COMMAND=scripts/docker-run.sh #Specify the executable we want to test against | ||
#PK_TEST_COMMAND_DOCKER=DOCKER #Specify if the test is for docker for filtering relevant tests | ||
|
||
# Debug node modules - https://nodejs.org/api/cli.html#node_debugmodule | ||
# NODE_DEBUG= | ||
|
||
# Debug node native modules - https://nodejs.org/api/cli.html#node_debug_nativemodule | ||
# NODE_DEBUG_NATIVE= | ||
|
||
# Path to PK executable to override tests/bin target | ||
# PK_TEST_COMMAND= | ||
|
||
# If set, indicates that `PK_TEST_COMMAND` is targetting docker | ||
# PK_TEST_COMMAND_DOCKER= |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Push container image to $CONTAINER_REPOSITORY | ||
# Pass the path to the container image archive | ||
# For example `deploy-image.sh $(nix-build ./release.nix -A docker` | ||
|
||
if [ -z "$CONTAINER_REPOSITORY" ]; then | ||
printf '%s\n' 'Missing $CONTAINER_REPOSITORY environment variable' >&2 | ||
exit 1 | ||
fi | ||
|
||
image="$1" | ||
|
||
if [ -z "$image" ]; then | ||
printf '%s\n' 'Missing path to container image archive' >&2 | ||
exit 1 | ||
fi | ||
|
||
container_tag="$(skopeo list-tags "docker-archive:$image" \ | ||
| jq -r '.Tags[0] | split(":")[1]')"; | ||
|
||
skopeo --insecure-policy copy \ | ||
"docker-archive:$image" \ | ||
"docker://$CONTAINER_REPOSITORY:$container_tag"; | ||
|
||
skopeo --insecure-policy copy \ | ||
"docker://$CONTAINER_REPOSITORY:$container_tag" \ | ||
"docker://$CONTAINER_REPOSITORY:latest"; |
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