This repository was archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 150
Updated instructions for local deployment #1582
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,69 @@ | ||
| #!/usr/bin/env bash | ||
| set -e | ||
| set -o pipefail | ||
|
|
||
| usage() { | ||
| echo "$(basename $0) deploy | undeploy" | ||
| echo " deploy: deploys the KeyTransparency server locally" | ||
| echo " undeploy: undeploys the KeyTransparency server" | ||
| } | ||
|
|
||
| function deploy() { | ||
| # Generate server's keys | ||
| if [ ! -f genfiles/key.pem ]; then | ||
| ./scripts/gen_monitor_keys.sh -f | ||
| cd genfiles | ||
| go run "$(go env GOROOT)/src/crypto/tls/generate_cert.go" --host localhost,127.0.0.1,:: | ||
| cd - | ||
| fi | ||
|
|
||
| # Start a docker swarm if not part of it | ||
| case "$(docker info --format '{{.Swarm.LocalNodeState}}')" in | ||
| active) | ||
| echo "Node is already in swarm cluster";; | ||
| *) | ||
| docker swarm init;; | ||
| esac | ||
|
|
||
| # Build the service's image | ||
| export TRAVIS_COMMIT=$(git rev-parse HEAD) | ||
| docker-compose build --parallel | ||
|
|
||
| # Deploy the set of services | ||
| docker stack deploy -c docker-compose.yml -c docker-compose.prod.yml kt | ||
| ./scripts/docker-stack-wait.sh -t 180 -n sequencer kt | ||
| docker run -t --network kt_attachable gcr.io/key-transparency/init:${TRAVIS_COMMIT} sequencer:8080 -- curl -k -X POST https://sequencer:8080/v1/directories -d'{"directory_id":"default","min_interval":"1s","max_interval":"60s"}' | ||
| ./scripts/docker-stack-wait.sh -t 180 kt | ||
|
|
||
| wget -T 60 --spider --retry-connrefused --waitretry=1 http://localhost:8081/readyz | ||
| wget -T 60 -O /dev/null --no-check-certificate \ | ||
| --retry-connrefused --waitretry=1 \ | ||
| --retry-on-http-error=405,404,503 \ | ||
| https://localhost/v1/directories/default | ||
|
|
||
| PASSWORD="foobar" | ||
| go run ./cmd/keytransparency-client authorized-keys create-keyset --password=${PASSWORD} | ||
| go run ./cmd/keytransparency-client post foo@bar.com \ | ||
| --insecure \ | ||
| --data='dGVzdA==' \ | ||
| --password=${PASSWORD} \ | ||
| --kt-url=localhost:443 \ | ||
| --verbose \ | ||
| --timeout=2m \ | ||
| --logtostderr | ||
| } | ||
|
|
||
| function undeploy() { | ||
| # Remove the stack "kt" | ||
| docker stack rm kt | ||
| } | ||
|
|
||
| # Start a docker swarm if not part of it | ||
| case "$1" in | ||
| deploy) | ||
| deploy;; | ||
| undeploy) | ||
| undeploy;; | ||
| *) | ||
| usage;; | ||
| esac |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This failed with the below error message:
It seems to be related to some autogenerated file not committed in the repo.