Skip to content

Commit 5a075e5

Browse files
Merge pull request #132 from bradmwilliams/ansible-rebuild-revert
Ansible rebuild revert
2 parents 7b91b1d + 5b40848 commit 5a075e5

File tree

2 files changed

+9
-47
lines changed

2 files changed

+9
-47
lines changed

ansible/rebuild_module.sh

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,26 @@
11
#!/usr/bin/env bash
22

33
# Directory in which this script resides
4-
ANSIBLE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
5-
6-
TEMPLATE_FILE="$ANSIBLE_DIR/roles/openshift_client_python/library/openshift_client_python.template.py"
7-
8-
if [ -n "$1" ]
9-
then
10-
echo "Running in container mode"
11-
TEMP_DIR="$1"
12-
OUTPUT_FILE="$TEMP_DIR/openshift_client_python.py"
13-
DIGEST_FILE="$TEMP_DIR/rebuild_module.digest"
14-
else
15-
OUTPUT_FILE="$ANSIBLE_DIR/roles/openshift_client_python/library/openshift_client_python.py"
16-
DIGEST_FILE="$ANSIBLE_DIR/rebuild_module.digest"
17-
fi
4+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
5+
6+
TEMPLATE_FILE="$DIR/roles/openshift_client_python/library/openshift_client_python.template.py"
7+
OUTPUT_FILE="$DIR/roles/openshift_client_python/library/openshift_client_python.py"
188

199
if [[ ! -f "$TEMPLATE_FILE" ]]; then
2010
echo "Unable to find template file: $TEMPLATE_FILE"
2111
exit 1
2212
fi
2313

24-
PACKAGES_DIR="$ANSIBLE_DIR/../packages"
14+
PACKAGES_DIR="$DIR/../packages"
2515
if [[ ! -d "$PACKAGES_DIR" ]]; then
2616
echo "Unable to find packages directory: $PACKAGES_DIR"
2717
exit 1
2818
fi
29-
pushd "$PACKAGES_DIR"
3019

20+
pushd "$PACKAGES_DIR"
3121
# Update module digest so that pr.groovy can ensure it is run after each module change
32-
cat $(find openshift/ -name '*.py' | sort -d) | md5sum > $DIGEST_FILE
33-
ENCODED_TGZ=$(tar c --owner=0 --numeric-owner --group=0 --mtime='UTC 2019-01-01' $(find openshift/ -name '*.py' | sort -d) | gzip -c -n | base64 --wrap=0)
34-
22+
cat $(find openshift/ -name '*.py' | sort) | md5sum > $DIR/rebuild_module.digest
23+
ENCODED_TGZ=$(tar c --owner=0 --numeric-owner --group=0 --mtime='UTC 2019-01-01' $(find openshift/ -name '*.py' | sort) | gzip -c -n | base64 --wrap=0)
3524
popd
3625

3726
echo "#!/usr/bin/env python" > $OUTPUT_FILE
@@ -56,4 +45,4 @@ done < "$TEMPLATE_FILE"
5645
if [[ "$replaced" != "1" ]]; then
5746
echo "Unable to find replacement pattern in template"
5847
exit 1
59-
fi
48+
fi

hack/verify-ansible-module.sh

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)