Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
UNLOCK
sync
Commits
54c85615
Commit
54c85615
authored
Jan 06, 2022
by
Jasper Koehorst
Browse files
sync setup function added
parent
4ca9d67b
Changes
2
Hide whitespace changes
Inline
Side-by-side
sync.sh
View file @
54c85615
...
...
@@ -8,9 +8,9 @@
#============================================================================
DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
usage
()
{
echo
"Usage:
$0
[-c|--cwl] [-r|--references] [-i|--infrastructure] [-a|--all]"
1>&2
;
exit
1
;
}
usage
()
{
echo
"Usage:
$0
[-c|--cwl] [-r|--references] [-i|--infrastructure]
[-s|--setup]
[-a|--all]"
1>&2
;
exit
1
;
}
vars
=
$(
getopt
-o
c:r:i:a:
--long
cwl:,references:,infrastructure:,all:
)
vars
=
$(
getopt
-o
c:r:i:
s:
a:
--long
cwl:,references:,infrastructure:,
setup:,
all:
)
#============================================================================
# KUBERNETES
...
...
@@ -36,12 +36,14 @@ if $runall; then
sed
"s/HOSTNAME/
$node
/g"
$DIR
/template_sync_cwl.yaml
>
$DIR
/
$node
\_
cwl.yaml
sed
"s/HOSTNAME/
$node
/g"
$DIR
/template_sync_infrastructure.yaml
>
$DIR
/
$node
\_
infrastructure.yaml
sed
"s/HOSTNAME/
$node
/g"
$DIR
/template_sync_references.yaml
>
$DIR
/
$node
\_
references.yaml
sed
"s/HOSTNAME/
$node
/g"
$DIR
/template_sync_install.yaml
>
$DIR
/
$node
\_
install.yaml
kubectl apply
-f
$DIR
/
$node
\_
cwl.yaml
kubectl apply
-f
$DIR
/
$node
\_
infrastructure.yaml
kubectl apply
-f
$DIR
/
$node
\_
references.yaml
kubectl apply
-f
$DIR
/
$node
\_
install.yaml
# Cleanup
rm
$DIR
/
$node
\_
cwl.yaml
$DIR
/
$node
\_
infrastructure.yaml
$DIR
/
$node
\_
references.yaml
rm
$DIR
/
$node
\_
cwl.yaml
$DIR
/
$node
\_
infrastructure.yaml
$DIR
/
$node
\_
references.yaml
$DIR
/
$node
\_
install.yaml
done
<
$DIR
/nodes.txt
...
...
@@ -80,6 +82,16 @@ for opt; do
rm
$DIR
/
$node
\_
infrastructure.yaml
done
<
$DIR
/nodes.txt
;;
-s
|
--setup
)
while
read
node
;
do
sed
"s/HOSTNAME/
$node
/g"
$DIR
/template_sync_setup.yaml
>
$DIR
/
$node
\_
setup.yaml
kubectl apply
-f
$DIR
/
$node
\_
setup.yaml
# Cleanup
rm
$DIR
/
$node
\_
setup.yaml
done
<
$DIR
/nodes.txt
;;
*
)
usage
...
...
template_sync_setup.yaml
0 → 100644
View file @
54c85615
apiVersion
:
v1
kind
:
Pod
metadata
:
name
:
munlock-sync-setup-HOSTNAME
namespace
:
unlock
labels
:
purpose
:
sync-folder-to-local-node
spec
:
containers
:
-
name
:
munlock-sync-HOSTNAME
image
:
docker-registry.wur.nl/unlock/docker:kubernetes
command
:
[
"
/bin/sh"
,
"
-c"
]
args
:
[
"
\
echo
starting;
\
chmod
+x
/unlock/infrastructure/binaries/scripts/setup.sh;
\
bash
-e
/unlock/infrastructure/binaries/scripts/setup.sh;
\
echo
finished;
\
"
]
volumeMounts
:
-
mountPath
:
/unlock
name
:
unlock
restartPolicy
:
OnFailure
volumes
:
-
name
:
unlock
persistentVolumeClaim
:
claimName
:
unlock
nodeSelector
:
kubernetes.io/hostname
:
HOSTNAME
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment