This repository has been archived by the owner on May 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dtkctl
executable file
·32 lines (26 loc) · 1.21 KB
/
dtkctl
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
#!/bin/bash
# Custom config variables
OCP_VERSION=$(oc get clusterversion/version -ojsonpath={.status.desired.version})
#DRIVER_TOOLKIT_IMAGE=$(oc adm release info $OCP_VERSION --image-for=driver-toolkit)
DRIVER_TOOLKIT_IMAGE="quay.io/ebelarte/dtk-light:0.3"
DRIVER_SOURCE_REPO_PULL="curl -L https://sourceforge.net/projects/e1000/files/ice\%20stable/1.7.16/ice-1.7.16.tar.gz/download | tar xvz"
DRIVER_SOURCE_DIR=ice-1.7.16/src
DRIVER_NAME=ice
# Substitute strings in templates
create_templates() {
sed -e "s#DRIVER_NAME#$DRIVER_NAME#g; s#DRIVER_TOOLKIT_IMAGE#$DRIVER_TOOLKIT_IMAGE#g; s#DRIVER_SOURCE_REPO_PULL#$DRIVER_SOURCE_REPO_PULL#g; s#DRIVER_SOURCE_DIR#$DRIVER_SOURCE_DIR#g" oc-templates/0001-buildconfig.yaml.template > oc-deploys/0001-buildconfig.yaml
sed -e "s#DRIVER_NAME#$DRIVER_NAME#g" oc-templates/0002-drivercontainer.yaml.template > oc-deploys/0002-drivercontainer.yaml
}
# Create buildconfig
install_buildconfig() {
oc create -f oc-deploys/0001-buildconfig.yaml
}
# Create drivercontainer. Should not be applied until buildconfig is completely done.
install_drivercontainer() {
oc create -f oc-deploys/0002-drivercontainer.yaml
}
# Delete last buildconfig and drivercontainer
destroy() {
oc delete -f oc-deploys/
}
"$@"