-
Notifications
You must be signed in to change notification settings - Fork 8
/
recreate.sh
86 lines (66 loc) · 2.73 KB
/
recreate.sh
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
set -x
set -e
echo "promoting changes in jx3-gitops-template to downstream templates"
#declare -a repos=("jx3-gke-gcloud-vault" "jx3-gke-terraform-vault" "jx3-gke-gcloud-gsm")
declare -a repos=("jx3-gke-gcloud-vault")
export TMPDIR=/tmp/jx3-gitops-promote
rm -rf $TMPDIR
mkdir -p $TMPDIR
export r="jx3-gke-gcloud-vault"
cd $TMPDIR
git clone https://github.com/jx3-gitops-repositories/$r.git
cd $r
mkdir -p .jx/secret/mapping
rm -rf bin src .jx/git-operator .jx/secret/mapping
kpt pkg get https://github.com/jenkins-x/jx3-gitops-template.git/.jx/secret/vault/mapping@master .jx/secret/mapping
kpt pkg get https://github.com/jenkins-x/jx3-gitops-template.git/.jx/git-operator@master .jx/git-operator
kpt pkg get https://github.com/jenkins-x/jx3-gitops-template.git/src@master src
kpt pkg get https://github.com/jenkins-x/jx3-gitops-template.git/infra/gcloud/bin@master bin
git add .jx src *
git commit -a -m "chore: latest from template"
git push
cd $TMPDIR
export r="jx3-gke-terraform-vault"
cd $TMPDIR
git clone https://github.com/jx3-gitops-repositories/$r.git
cd $r
mkdir -p .jx/secret/mapping
rm -rf src .jx/git-operator .jx/secret/mapping
kpt pkg get https://github.com/jenkins-x/jx3-gitops-template.git/.jx/secret/vault/mapping@master .jx/secret/mapping
kpt pkg get https://github.com/jenkins-x/jx3-gitops-template.git/.jx/git-operator@master .jx/git-operator
kpt pkg get https://github.com/jenkins-x/jx3-gitops-template.git/src@master src
git add .jx src *
git commit -a -m "chore: latest from template"
git push
cd $TMPDIR
export r="jx3-kind-vault"
cd $TMPDIR
git clone https://github.com/jx3-gitops-repositories/$r.git
cd $r
mkdir -p .jx/secret/mapping
rm -rf src .jx/git-operator .jx/secret/mapping
kpt pkg get https://github.com/jenkins-x/jx3-gitops-template.git/.jx/git-operator@master .jx/git-operator
kpt pkg get https://github.com/jenkins-x/jx3-gitops-template.git/.jx/secret/vault/mapping@master .jx/secret/mapping
kpt pkg get https://github.com/jenkins-x/jx3-gitops-template.git/src@master src
git add .jx src *
git commit -a -m "chore: latest from template"
git push
cd $TMPDIR
export r="jx3-gke-gcloud-gsm"
cd $TMPDIR
git clone https://github.com/jx3-gitops-repositories/$r.git
cd $r
mkdir -p .jx/secret/mapping
rm -rf src .jx/git-operator .jx/secret/mapping
kpt pkg get https://github.com/jenkins-x/jx3-gitops-template.git/.jx/git-operator@master .jx/git-operator
kpt pkg get https://github.com/jenkins-x/jx3-gitops-template.git/.jx/secret/gsm/mapping@master .jx/secret/mapping
kpt pkg get https://github.com/jenkins-x/jx3-gitops-template.git/src@master src
git add .jx src *
git commit -a -m "chore: latest from template"
git push
#for r in "${repos[@]}"
#do
# echo "upgrading repository https://github.com/jx3-gitops-repositories/$r"
#
#done