Skip to content

Commit 0a3b4ad

Browse files
committed
feat: Create justfile for workflow automation
Signed-off-by: Oliver Kautz <oliver.kautz@gonicus.de>
1 parent 404abc1 commit 0a3b4ad

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

justfile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# use with https://github.com/casey/just
2+
#
3+
# Cluster Stack Creation automation
4+
#
5+
6+
set export
7+
set dotenv-filename := "just.env"
8+
set dotenv-load
9+
10+
path := env_var('PATH') + ":" + justfile_directory() + "/bin"
11+
12+
default:
13+
@just --list --justfile {{justfile()}}
14+
15+
# Check if csctl and clusterstack-provider-openstack are available and build them if neccessary
16+
[no-cd]
17+
ensure-dependencies:
18+
#!/usr/bin/env bash
19+
export PATH=${path}
20+
if ! which csctl >/dev/null 2>&1;then
21+
echo "csctl not found, building it from source."
22+
mkdir -p bin
23+
pushd bin
24+
git clone https://github.com/SovereignCloudStack/csctl csctl-git
25+
pushd csctl-git
26+
make build
27+
mv csctl ../csctl
28+
popd
29+
rm -rf csctl-git
30+
popd
31+
fi
32+
33+
if ! which csctl-openstack >/dev/null 2>&1; then
34+
echo "csctl-plugin-openstack not found, building it from source."
35+
mkdir -p bin
36+
pushd bin
37+
git clone https://github.com/SovereignCloudStack/csctl-plugin-openstack
38+
pushd csctl-plugin-openstack
39+
make build
40+
mv csctl-openstack ../csctl-openstack
41+
popd
42+
rm -rf csctl-plugin-openstack
43+
popd
44+
fi
45+
46+
if [[ -d bin ]]; then
47+
export PATH="${PATH}:$(pwd)/bin"
48+
fi
49+
50+
# Clean temporary files and binaries
51+
clean:
52+
#!/usr/bin/env bash
53+
rm -rf bin
54+
55+
# Build Clusterstacks version
56+
build: ensure-dependencies
57+
./hack/generate_version.py --build

0 commit comments

Comments
 (0)