-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Setting project version 0.9.0 and parent version 6.0.0-beta200…
…415181825.
- Loading branch information
1 parent
547615b
commit 8bf9cf9
Showing
33 changed files
with
205 additions
and
27 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright [2017 - 2020] Confluent Inc. | ||
# | ||
|
||
# Get a secret from Vault. You must already be logged in using the vault-login.sh script. | ||
# You must provide the path to the secret and the secret key for which you want the value. | ||
# The path to the secret is relative to v1/ci/kv | ||
# | ||
# Arguments: | ||
# $1 The path to the secret relative to v1/ci/kv | ||
# $2 The key in the secret you want the value for | ||
# | ||
|
||
set +x | ||
|
||
SECRET=$1 | ||
KEY=$2 | ||
export VAULT_ADDR=https://vault.cireops.gcp.internal.confluent.cloud | ||
|
||
if SECRET_VALUE=$(vault kv get -field "$KEY" v1/ci/kv/"$SECRET"); then | ||
echo "$SECRET_VALUE" | ||
else | ||
echo "Failed to get secret and key: $SECRET, $KEY" | ||
exit 1 | ||
fi |
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,35 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright [2017 - 2020] Confluent Inc. | ||
# | ||
|
||
# Login to Vault using the tools role ID and Secret ID. | ||
# | ||
|
||
export VAULT_ADDR=https://vault.cireops.gcp.internal.confluent.cloud | ||
|
||
if [[ -z "$VAULT_ROLE_ID" ]]; then | ||
echo "Error: The VAULT_ROLE_ID is not set." | ||
exit 1 | ||
fi | ||
|
||
if [[ -z "$VAULT_SECRET_ID" ]]; then | ||
echo "Error: The VAULT_SECRET_ID is not set." | ||
exit 1 | ||
fi | ||
|
||
echo "Getting Vault token with tools Role ID and Secret ID" | ||
VAULT_TOKEN=$(vault write -field=token auth/app/prod/login role_id="$VAULT_ROLE_ID" secret_id="$VAULT_SECRET_ID") | ||
|
||
if [[ -z "$VAULT_TOKEN" ]]; then | ||
echo "Failed to get Vault token." | ||
exit 1 | ||
fi | ||
|
||
echo "Logging into Vault with token." | ||
if vault login "$VAULT_TOKEN" >/dev/null 2>&1; then | ||
echo "Successfully logged into Vault." | ||
else | ||
echo "Failed to login to Vault." | ||
exit 1 | ||
fi |
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,22 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright [2017 - 2020] Confluent Inc. | ||
# | ||
|
||
set -e | ||
|
||
if [[ -z "${ARTIFACTORY_USERNAME}" || -z "${ARTIFACTORY_PASSWORD}" ]]; then | ||
echo "Please export env ARTIFACTORY_USERNAME and ARTIFACTORY_PASSWORD with Jfrog Artifactory username and password" | ||
exit 1 | ||
fi | ||
|
||
PIP_CONF=~/.pip/pip.conf | ||
|
||
mkdir -p `dirname ${PIP_CONF}` | ||
|
||
if [ -e "${PIP_CONF}" ]; then | ||
echo "${PIP_CONF} already exists and will be used" | ||
else | ||
echo -e "[global]\nindex-url = https://${ARTIFACTORY_USERNAME}:${ARTIFACTORY_PASSWORD}@confluent.jfrog.io/confluent/api/pypi/pypi/simple" > ${PIP_CONF} | ||
echo "Created ${PIP_CONF} with Jfrog Artifactory repository" | ||
fi |
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,29 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright [2017 - 2020] Confluent Inc. | ||
# | ||
|
||
set -e | ||
|
||
if [[ -z $ARTIFACTORY_USERNAME || -z $ARTIFACTORY_PASSWORD ]]; then | ||
echo "Please export env ARTIFACTORY_USERNAME and ARTIFACTORY_PASSWORD with Jfrog Artifactory username and password" | ||
exit 1 | ||
fi | ||
|
||
PYPIRC=~/.pypirc | ||
|
||
if [ -e $PYPIRC ]; then | ||
echo "$PYPIRC already exists and will be used." | ||
else | ||
echo "\ | ||
[distutils] | ||
index-servers = | ||
jfrog | ||
[jfrog] | ||
repository: https://confluent.jfrog.io/confluent/api/pypi/pypi-internal | ||
username: $ARTIFACTORY_USERNAME | ||
password: $ARTIFACTORY_PASSWORD | ||
" > $PYPIRC | ||
echo "Created $PYPIRC with Jfrog Artifactory repository" | ||
fi |
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,43 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright [2017 - 2020] Confluent Inc. | ||
# | ||
|
||
# Extract AWS credential using its assigned IAM role. | ||
# | ||
# This script is meant to be sourced by a parent script, so from your parent script: | ||
# . jenkins-common/scripts/aws/extract-iam-credential.sh | ||
|
||
[ -o xtrace ] && restore_trace='set -x' || restore_trace='set +x' | ||
set +x | ||
|
||
|
||
if [[ ${AWS_ACCESS_KEY_ID:-} && ${AWS_ACCESS_KEY:-} && ${AWS_SECRET_ACCESS_KEY:-} && ${AWS_SECRET_KEY:-} && ! ${AWS_SESSION_TOKEN:-} ]]; then | ||
echo "Using existing AWS credential from env" | ||
else | ||
echo "Extracting AWS credential based on IAM role" | ||
|
||
if [[ ! "${AWS_IAM:-}" ]];then | ||
# Get the iam rolename associated with this ec2 instance. The curl command actually fetches the iam instance profile associated with this ec2 node, | ||
# and what we really need is the iam role name, so we rely on the convention that | ||
# iam instance profile name and iam role name are the same | ||
export AWS_IAM=$(curl -s http://169.254.169.254/latest/meta-data/iam/info | grep InstanceProfileArn | cut -d '"' -f 4 | cut -d '/' -f 2) | ||
fi | ||
|
||
export AWS_ACCESS_KEY_ID=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM | grep AccessKeyId | awk -F\" '{ print $4 }'` | ||
export AWS_ACCESS_KEY="$AWS_ACCESS_KEY_ID" | ||
export AWS_SECRET_KEY=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM | grep SecretAccessKey | awk -F\" '{ print $4 }'` | ||
export AWS_SECRET_ACCESS_KEY="$AWS_SECRET_KEY" | ||
export AWS_SESSION_TOKEN=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM | grep Token | awk -F\" '{ print $4 }'` | ||
|
||
if [ -z "$AWS_ACCESS_KEY" ]; then | ||
echo "Failed to populate environment variables AWS_ACCESS_KEY, AWS_SECRET_KEY, and AWS_SESSION_TOKEN." | ||
echo "AWS_IAM is currently $AWS_IAM. Double-check that this is correct. If not, update AWS_IAM env in aws.sh" | ||
exit 1 | ||
fi | ||
|
||
fi | ||
|
||
export AWS_DEFAULT_REGION=us-west-2 | ||
|
||
eval "$restore_trace" |
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
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
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
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
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
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
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
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
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
Oops, something went wrong.