File tree Expand file tree Collapse file tree 4 files changed +37
-24
lines changed Expand file tree Collapse file tree 4 files changed +37
-24
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ SCRIPT_DIR=" $( cd " $( dirname " ${0} " ) " && pwd) "
4
+ BASE_DIR=" $( cd " ${SCRIPT_DIR} /.." && pwd) "
5
+
6
+ AD_DEPLOYMENT_YAML=" ${SCRIPT_DIR} /files/samba-ad-server-deployment.yml"
7
+ AD_DEPLOYMENT_NAME=" samba-ad-server"
8
+
9
+ KEEP=${KEEP:- 0}
10
+
11
+ _error () {
12
+ echo " $@ "
13
+ exit 1
14
+ }
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
-
4
3
SCRIPT_DIR=" $( cd " $( dirname " ${0} " ) " && pwd) "
5
- BASE_DIR=" $( cd " ${SCRIPT_DIR} /.." && pwd) "
6
- DEPLOYMENT_YAML=" ${BASE_DIR} /tests/files/samba-ad-server-deployment.yml"
7
- DEPLOYMENT_NAME=" samba-ad-server"
8
4
9
- _error () {
10
- echo " $@ "
11
- exit 1
12
- }
5
+ source " ${SCRIPT_DIR} /common.sh"
13
6
14
7
echo " Creating ad server deployment..."
15
- ERROR_MSG=$( kubectl create -f " ${DEPLOYMENT_YAML } " 2>&1 1> /dev/null)
8
+ ERROR_MSG=$( kubectl create -f " ${AD_DEPLOYMENT_YAML } " 2>&1 1> /dev/null)
16
9
if [ $? -ne 0 ] ; then
17
10
if [[ " ${ERROR_MSG} " =~ " AlreadyExists" ]] ; then
18
11
echo " Deployment exists already. Continuing."
23
16
24
17
kubectl get deployment
25
18
26
- replicaset=" $( kubectl describe deployment ${DEPLOYMENT_NAME } | grep -s " NewReplicaSet:" | awk ' { print $2 }' ) "
19
+ replicaset=" $( kubectl describe deployment ${AD_DEPLOYMENT_NAME } | grep -s " NewReplicaSet:" | awk ' { print $2 }' ) "
27
20
[ $? -eq 0 ] || _error " Error getting replicaset"
28
21
29
22
podname=" $( kubectl get pod | grep $replicaset | awk ' { print $1 }' ) "
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ SCRIPT_DIR=" $( cd " $( dirname " ${0} " ) " && pwd) "
4
+
5
+ source " ${SCRIPT_DIR} /common.sh"
6
+
7
+ if [ ${KEEP} -eq 1 ]; then
8
+ echo " keeping ad server deployment (KEEP=1)"
9
+ exit 0
10
+ fi
11
+
12
+ echo " removing ad server deployment..."
13
+ kubectl delete deployment " ${AD_DEPLOYMENT_NAME} "
14
+ [ $? -eq 0 ] || _error " Error deleting deployment"
15
+ echo
16
+ echo " ad server deployment removed"
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
3
SCRIPT_DIR=" $( cd " $( dirname " ${0} " ) " && pwd) "
4
- BASE_DIR=" $( cd " ${SCRIPT_DIR} /.." && pwd) "
5
- DEPLOYMENT_YAML=" ${BASE_DIR} /tests/files/samba-ad-server-deployment.yml"
6
- DEPLOYMENT_NAME=" samba-ad-server"
7
4
8
- _error () {
9
- echo " $@ "
10
- exit 1
11
- }
5
+ source " ${SCRIPT_DIR} /common.sh"
12
6
13
- . ${BASE_DIR} /tests /test-deploy-ad-server.sh
7
+ source ${SCRIPT_DIR} /test-deploy-ad-server.sh
14
8
15
9
kubectl exec " ${podname} " -- samba-tool domain info 127.0.0.1
16
10
[ $? -eq 0 ] || _error " Error listing domain info"
17
11
echo
18
12
19
- if [ ${KEEP} -eq 0 ]; then
20
- echo " removing ad server deployment again..."
21
- kubectl delete deployment " samba-ad-server"
22
- [ $? -eq 0 ] || _error " Error deleting deployment"
23
- echo
24
- fi
13
+ source ${SCRIPT_DIR} /test-remove-ad-server.sh
25
14
15
+ echo
26
16
echo " Success"
27
17
exit 0
You can’t perform that action at this time.
0 commit comments