-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from engineerd/trishankatdatadog/useful-dev-sc…
…ripts Useful dev scripts
- Loading branch information
Showing
14 changed files
with
152 additions
and
47 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
# Clone Notary. | ||
(cd /tmp; go get github.com/theupdateframework/notary) | ||
|
||
# We will sign and push this to our localhost Notary and Registry. | ||
docker pull hello-world | ||
docker tag hello-world localhost:5000/hello-world | ||
docker images |
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,5 @@ | ||
#!/bin/bash | ||
|
||
docker images -a | grep "hello-world" | awk '{print $3}' | xargs docker rmi -f | ||
|
||
DOCKER_CONTENT_TRUST=1 DOCKER_CONTENT_TRUST_SERVER=https://localhost:4443 docker -D pull localhost:5000/hello-world: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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
DOCKER_CONTENT_TRUST=1 DOCKER_CONTENT_TRUST_SERVER=https://localhost:4443 docker -D push localhost:5000/hello-world: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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
brew install fswatch | ||
|
||
# https://emcrisostomo.github.io/fswatch/doc/1.14.0/fswatch.html/Tutorial-Introduction-to-fswatch.html#Detecting-File-System-Changes | ||
# NOTE: We exclude bin/* to avoid infinite loop. | ||
# TODO: Exclude *.sh, *.md, and other non-source files. | ||
# FIXME: Sometimes fswatch fires a few times in a row. It is what it is. | ||
fswatch -o . -e "bin/*" | (while read; do make install; date; echo; done) |
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,16 @@ | ||
#!/bin/bash | ||
|
||
NOTARY=$GOPATH/src/github.com/theupdateframework/notary | ||
|
||
(cd $NOTARY; docker-compose up -d) | ||
|
||
docker run -d \ | ||
--name registry \ | ||
-p 5000:5000 \ | ||
-v $NOTARY/fixtures:/certs \ | ||
-e REGISTRY_HTTP_ADDR=0.0.0.0:5000 \ | ||
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/notary-server.crt \ | ||
-e REGISTRY_HTTP_TLS_KEY=/certs/notary-server.key \ | ||
registry:2 | ||
|
||
docker ps |
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,6 @@ | ||
#!/bin/bash | ||
|
||
docker rm registry | ||
docker volume prune | ||
rm -rf ~/.signy | ||
rm -rf ~/.docker/trust/tuf/localhost:5000 |
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,7 @@ | ||
# NOTE: Clearly don't do this in production. | ||
PASSPHRASE=0xdeadbeef | ||
|
||
export SIGNY_ROOT_PASSPHRASE=$PASSPHRASE | ||
export SIGNY_TARGETS_PASSPHRASE=$PASSPHRASE | ||
export SIGNY_SNAPSHOT_PASSPHRASE=$PASSPHRASE | ||
export SIGNY_DELEGATION_PASSPHRASE=$PASSPHRASE |
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,4 @@ | ||
#!/bin/bash | ||
|
||
# FIXME: list does not seem to work right now | ||
signy --tlscacert=$GOPATH/src/github.com/theupdateframework/notary/cmd/notary/root-ca.crt --server=https://localhost:4443 --log=info list localhost:5000/thin-bundle:v1 |
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,5 @@ | ||
#!/bin/bash | ||
|
||
source scripts/signy-env.sh | ||
|
||
signy --tlscacert=$GOPATH/src/github.com/theupdateframework/notary/cmd/notary/root-ca.crt --server=https://localhost:4443 --log=info sign testdata/cnab/bundle.json localhost:5000/thin-bundle:v1 |
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,18 @@ | ||
#!/bin/bash | ||
|
||
NOTARY=$GOPATH/src/github.com/theupdateframework/notary | ||
|
||
(cd $NOTARY; docker-compose up -d) | ||
|
||
# NOTE: Notary (see scripts/notary-start.sh) seems to require TLS for both the | ||
# Registry and itself. However, that setup breaks cnab-to-oci (required for | ||
# signy), most likely because we use a self-signed root here. Until we fix | ||
# this, it is easiest to use two different scripts to initalize the Registry | ||
# for Notary and signy. | ||
docker run -d \ | ||
--name registry \ | ||
-p 5000:5000 \ | ||
-e REGISTRY_HTTP_ADDR=0.0.0.0:5000 \ | ||
registry:2 | ||
|
||
docker ps |
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,3 @@ | ||
#!/bin/bash | ||
|
||
signy --tlscacert=$GOPATH/src/github.com/theupdateframework/notary/cmd/notary/root-ca.crt --server=https://localhost:4443 --log=info verify localhost:5000/thin-bundle:v1 |
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,8 @@ | ||
#!/bin/bash | ||
|
||
NOTARY=$GOPATH/src/github.com/theupdateframework/notary | ||
|
||
(cd $NOTARY; docker-compose down) | ||
|
||
docker stop registry | ||
docker ps |