-
Notifications
You must be signed in to change notification settings - Fork 28
/
update-pks-team
executable file
·50 lines (41 loc) · 1.16 KB
/
update-pks-team
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# source this file to provide bash Utilities for updating pks-related pipelines
TARGET="kubo-pks"
TEAM_NAME="pks"
function login {
fly --target $TARGET login \
--concourse-url=https://ci.kubo.sh \
--team-name=$TEAM_NAME \
--open-browser
}
function update-team-permissions {
fly --target $TARGET set-team \
--team-name=$TEAM_NAME \
--config concourse/team-configs/pks.yaml
}
function get-credhub-credentials {
pushd ~/workspace/kubo-locks/concourse/gcp || return
eval "$(bbl print-env)"
popd || return
}
function copy-sshkey {
get-credhub-credentials
# TODO: find the real source of this val in lastpass or something
EXISTING_VAL=$(credhub get -n /concourse/main/git-ssh-key -j)
credhub set \
--name /concourse/"$TEAM_NAME"/git-ssh-key \
--private "$(echo "$EXISTING_VAL" | jq .value.private_key)" \
--type ssh
}
function fly-verification-pipeline {
fly --target $TARGET set-pipeline \
--pipeline=minimum-release-verification \
--config=pks-pipelines/minimum-release-verification/pipeline.yml
}
#function main {
# login
# update-team-permissions
# copy-sshkey
# fly-verification-pipeline
#}
#main