forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow repo to be tagged automatically on commit to main branch (airbn…
…b) (open-telemetry#2) * git tagging in CI * use version from versions.yaml * only run if airbnb branch * only run if airbnb branch * clean up * tag only component * dry as a bone
- Loading branch information
Showing
5 changed files
with
124 additions
and
2 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,93 @@ | ||
--- | ||
# Generated by: onetouch-gen v1.26.3 (titanic: e28693593a57d500d94cdd97ceddff82c776522a) | ||
|
||
# This is a simple CI job. A CI job comprises a list of steps that run | ||
# sequentially in a container described by an image or a Dockerfile. | ||
# | ||
# Questions? Visit air.bb/ci-docs or ask a question on Stack Overflow with | ||
# the tag #continuous-integration. | ||
|
||
dockerfile: ../Dockerfile | ||
|
||
steps: | ||
- type: run | ||
label: set up ssh | ||
env: | ||
GHE_DEPLOY_KEY: "{% secret key=GHE_DEPLOY_KEY %}" | ||
command: | | ||
set -ex | ||
# Make .ssh directory | ||
mkdir ~/.ssh | ||
# Put the deploy key on disk | ||
SSH_KEY=/tmp/ghe-deploy-key | ||
openssl enc -d -aes-256-cbc -in _infra/ci/secrets/id_rsa_otel.enc -out ${SSH_KEY} -pass pass:${GHE_DEPLOY_KEY} | ||
chmod 600 $SSH_KEY | ||
# Set up the SSH configs | ||
SSH_CONFIG=~/.ssh/config | ||
cat <<EOF > $SSH_CONFIG | ||
Host git.musta.ch | ||
IdentityFile $SSH_KEY | ||
StrictHostKeyChecking no | ||
ServerAliveInterval 10 | ||
ServerAliveCountMax 10 | ||
TCPKeepAlive yes | ||
EOF | ||
chmod 600 $SSH_CONFIG | ||
# Final check, and print the public key and config | ||
git --version | ||
ssh-keygen -y -f $SSH_KEY | ||
cat $SSH_CONFIG | ||
- type: run | ||
label: set up git repo | ||
command: | | ||
set -ex | ||
git_with_retries() { | ||
MAX_ITERATIONS=${MAX_ITERATIONS:-6} | ||
SUCCEEDED=0 | ||
echo "Attempting to execute: git $* with $MAX_ITERATIONS retries" | ||
for i in $(seq "$MAX_ITERATIONS"); do | ||
# Try running the command. | ||
if git "$@"; then | ||
echo 'The command succeeded.' | ||
SUCCEEDED=1 | ||
break | ||
fi | ||
# If we aren't in the last iteration, sleep and try again. | ||
if [ "$i" -lt "$MAX_ITERATIONS" ]; then | ||
SLEEP_DURATION="$((3 ** i))" | ||
echo "The command failed. Waiting $SLEEP_DURATION seconds..." | ||
sleep "$SLEEP_DURATION" | ||
fi | ||
done | ||
# Fail if the none of the attempts succeeded. | ||
if [ "$SUCCEEDED" -eq 0 ]; then | ||
echo 'The command never succeeded.' | ||
false | ||
fi | ||
} | ||
echo "Update to master for release branch creation..." | ||
git_with_retries clone "$JORB_DISPATCHER_GIT_DIR" /jorb/repo-copy-rw | ||
cd /jorb/repo-copy-rw | ||
git config --global user.email "buildkite@airbnb.com" | ||
git config --global user.name "buildkite" | ||
git rev-parse HEAD | ||
git remote remove origin | ||
git remote add origin git@git.musta.ch:third-party/opentelemetry-collector-contrib.git | ||
- type: run | ||
label: Tag repo | ||
command: | | ||
cd /jorb/repo-copy-rw | ||
TAG=${COMPONENT_PATH}/$(yq '.module-sets.contrib-base.version' versions.yaml)-${JORB_GIT_BRANCH}-$(git rev-parse --short HEAD) | ||
git tag $TAG | ||
git push origin $TAG |
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,14 @@ | ||
{ | ||
"GHE_DEPLOY_KEY": { | ||
"value": "ju6S06bULPkZElVlhEFtcDH/uQPcYV9WDcDj6g==", | ||
"iv": "5lCpHHPZH5E0vSan", | ||
"__keys__": { | ||
"__shared__ci_secrets.production": { | ||
"key": "NFroNnVruir2XerdDt2Xk5x8f8Zll0NpXIf4CWYk1B3lx2oed9n5Ddfo4YOWVluEKk/ru1Wpwo34alQEpe+ckxZVgGuFWdbENGYy1fdtfREIuM4KUfC+dlkCOlBayiVT4YoYWhfqpAwueZRNYMGtG1Dm+JZ9kk+wuQZGQt8+qXtcJXZMn06kZNked2oaR/ZzcWwZUKqgBDeV44BVkdsMnV+jlbSamiJ6RsyAdl+xHvZ0IKFA05WZGEAueoMgqeRwnfzlRzcoQo55aLJT9SKFnPPBgRE/4EEiRl3Hc0HdSWLLn54AWq0mGVyXjMR4vZJ0adlzOw2iCrNjs34gMYA8YQ==", | ||
"sig": "90bff42516bebc2d2d3df04ff0a085b48676a2ccd1438394a0b9eef84b5d5d1c" | ||
} | ||
}, | ||
"auth_tag": "1ajbH9mfszNRCVQx87khVQ==", | ||
"annotations": "eyJ1cGRhdGVkX2F0IjoxNjU5NDAzNzAzLCJ1c2FnZV9jb250ZXh0Ijp7ImdpdF9yZXBvX3NsdWciOiJ0aGlyZC1wYXJ0eS9vcGVudGVsZW1ldHJ5LWNvbGxlY3Rvci1jb250cmliIn19" | ||
} | ||
} |
Binary file not shown.