Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Documentation/dev/libvirt-howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ bazel build tarball
### 3. Create a cluster
```sh
tar -zxf bazel-bin/tectonic-dev.tar.gz
cd tectonic-dev
export PATH="${PWD}/installer:${PATH}"
alias tectonic="${PWD}/tectonic-dev/installer/tectonic"
```

Initialize (the environment variables are a convenience):
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ These instructions can be used for AWS:
3. Extract the tarball
```sh
tar -zxf bazel-bin/tectonic-dev.tar.gz
cd tectonic-dev
```

4. Add binaries to $PATH
4. Create an alias for tectonic
```sh
export PATH="${PWD}/installer:${PATH}"
alias tectonic="${PWD}/tectonic-dev/installer/tectonic"
```

5. Edit Tectonic configuration file including the $CLUSTER_NAME
Expand Down
17 changes: 13 additions & 4 deletions installer/pkg/workflow/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (ex *executor) execute(clusterDir string, args ...string) error {
return cmd.Run()
}

// tfBinatyPath searches for a TerraForm binary on disk:
// tfBinaryPath searches for a TerraForm binary on disk:
// - in the executing binary's folder,
// - in the current working directory,
// - in the PATH.
Expand All @@ -79,9 +79,18 @@ func tfBinaryPath() (string, error) {
binaryFileName = tfBinWindows
}

// Look into the executable's folder.
if execFolderPath, err := filepath.Abs(filepath.Dir(os.Args[0])); err == nil {
path := filepath.Join(execFolderPath, binaryFileName)
// Find the current executable's path, gets an absolute path or error
execPath, err := os.Executable()
if err == nil {
// execPath could be a symlink
if stat, err := os.Stat(execPath); err == nil && (stat.Mode()&os.ModeSymlink) == os.ModeSymlink {
if evalExecPath, err := filepath.EvalSymlinks(execPath); err != nil {
execPath = evalExecPath
}
}

// Look into the executable's folder.
path := filepath.Join(filepath.Dir(execPath), binaryFileName)
if stat, err := os.Stat(path); err == nil && !stat.IsDir() {
return path, nil
}
Expand Down
8 changes: 4 additions & 4 deletions tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ SMOKE_TEST_OUTPUT="Never executed. Problem with one of previous stages"
[ -z ${DOMAIN+x} ] && DOMAIN="tectonic-ci.de"
[ -z ${JOB_NAME+x} ] && PREFIX="${USER:-test}" || PREFIX="ci-${JOB_NAME#*/}"
CLUSTER_NAME=$(echo "${PREFIX}-$(uuidgen -r | cut -c1-5)" | tr '[:upper:]' '[:lower:]')
TECTONIC="${PWD}/tectonic-dev/installer/tectonic"
exec &> >(tee -a "$CLUSTER_NAME.log")

function destroy() {
echo -e "\\e[34m Exiting... Destroying Tectonic...\\e[0m"
tectonic destroy --dir="${CLUSTER_NAME}"
"${TECTONIC}" destroy --dir="${CLUSTER_NAME}"
echo -e "\\e[36m Finished! Smoke test output:\\e[0m ${SMOKE_TEST_OUTPUT}"
echo -e "\\e[34m So Long, and Thanks for All the Fish\\e[0m"
}
Expand All @@ -33,7 +34,6 @@ bazel build tarball smoke_tests
echo -e "\\e[36m Unpacking artifacts...\\e[0m"
tar -zxf bazel-bin/tectonic-dev.tar.gz
cp bazel-bin/tests/smoke/linux_amd64_stripped/go_default_test tectonic-dev/smoke
export PATH="${PWD}/tectonic-dev/installer:${PATH}"
cd tectonic-dev

### HANDLE SSH KEY ###
Expand Down Expand Up @@ -91,10 +91,10 @@ python <<-EOF >"${CLUSTER_NAME}.yaml"
EOF

echo -e "\\e[36m Initializing Tectonic...\\e[0m"
tectonic init --config="${CLUSTER_NAME}".yaml
"${TECTONIC}" init --config="${CLUSTER_NAME}".yaml

echo -e "\\e[36m Deploying Tectonic...\\e[0m"
tectonic install --dir="${CLUSTER_NAME}"
"${TECTONIC}" install --dir="${CLUSTER_NAME}"
echo -e "\\e[36m Running smoke test...\\e[0m"
export SMOKE_KUBECONFIG="${PWD}/${CLUSTER_NAME}/generated/auth/kubeconfig"
export SMOKE_NODE_COUNT="5" # Sum of all nodes (master + worker)
Expand Down