Skip to content

Commit

Permalink
[recipes] Remove duplicate definitions of get-tc-secreet
Browse files Browse the repository at this point in the history
  • Loading branch information
pyoor committed Jan 2, 2025
1 parent 01f9753 commit 3828984
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
21 changes: 6 additions & 15 deletions services/domino-web-tests/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,14 @@
set -e
set -o pipefail

function retry () {
for _ in {1..9}; do
"$@" && return
sleep 30
done
"$@"
}
# shellcheck source=recipes/linux/common.sh
source "${0%/*}/common.sh"

function get-secret () {
TASKCLUSTER_ROOT_URL="${TASKCLUSTER_PROXY_URL-$TASKCLUSTER_ROOT_URL}" retry taskcluster api secrets get "$1"
}

get-secret project/fuzzing/deploy-domino-web-tests | jshon -e secret -e key -u >.ssh/id_ecdsa.domino_web_tests
get-tc-secret project/fuzzing/deploy-domino-web-tests >.ssh/id_ecdsa.domino_web_tests
ln -s id_ecdsa.domino_web_tests .ssh/id_ecdsa
get-secret project/fuzzing/deploy-domino | jshon -e secret -e key -u >.ssh/id_rsa.domino
get-secret project/fuzzing/deploy-gridl | jshon -e secret -e key -u >.ssh/id_rsa.gridl
get-secret project/fuzzing/deploy-octo-private | jshon -e secret -e key -u >.ssh/id_rsa.octo
get-tc-secret project/fuzzing/deploy-domino >.ssh/id_rsa.domino
get-tc-secret project/fuzzing/deploy-gridl >.ssh/id_rsa.gridl
get-tc-secret project/fuzzing/deploy-octo-private >.ssh/id_rsa.octo
set -x
chmod 0400 .ssh/id_*

Expand Down
8 changes: 2 additions & 6 deletions services/langfuzz/launch-langfuzz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,19 @@ set -o pipefail
# shellcheck source=recipes/linux/common.sh
source /src/recipes/common.sh

function tc-get-secret () {
TASKCLUSTER_ROOT_URL="${TASKCLUSTER_PROXY_URL-$TASKCLUSTER_ROOT_URL}" retry taskcluster api secrets get "project/fuzzing/$1"
}

if [[ -n "$TASK_ID" ]] || [[ -n "$RUN_ID" ]] ; then
TARGET_TIME="$(($(get-deadline) - $(date +%s) - 5 * 60))"
else
TARGET_TIME=$((10 * 365 * 24 * 3600))
fi

# Get the deploy key for langfuzz-config from Taskcluster
tc-get-secret deploy-langfuzz-config | jshon -e secret -e key -u > /root/.ssh/id_rsa.langfuzz-config
get-tc-secret deploy-langfuzz-config > /root/.ssh/id_rsa.langfuzz-config
chmod 0600 /root/.ssh/id_rsa.*

# Config and run the logging service
mkdir -p /etc/google/auth /var/lib/td-agent-bit/pos
tc-get-secret google-logging-creds | jshon -e secret -e key > /etc/google/auth/application_default_credentials.json
get-tc-secret google-logging-creds > /etc/google/auth/application_default_credentials.json
chmod 0600 /etc/google/auth/application_default_credentials.json
/opt/td-agent-bit/bin/td-agent-bit -c /etc/td-agent-bit/td-agent-bit.conf

Expand Down

0 comments on commit 3828984

Please sign in to comment.