Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add terramate create <path> #449

Merged
merged 13 commits into from
Jul 6, 2022
Merged

Conversation

katcipis
Copy link
Contributor

@katcipis katcipis commented Jul 6, 2022

Introduces the terramate create command on the CLI. Example:

#!/bin/bash

set -o errexit
set -o nounset
set -o pipefail

workdir=$(mktemp -d)
cd "${workdir}" || exit

cat > terramate.tm.hcl <<- EOM
terramate {
  config {
  }
}
EOM

terramate create stack 
cat stack/stack.tm.hcl
echo

mkdir common
touch common/file1.tm.hcl
touch common/file2.tm.hcl

mkdir stacks
cd stacks

terramate create stack-1 \
    --name "stack name" \
    --description "stack description" \
    --id "stack-id" \
    --import "/common/file1.tm.hcl" \
    --import "/common/file2.tm.hcl"

cat stack-1/stack.tm.hcl
echo

cd ..

echo "final structure"
tree

@katcipis katcipis self-assigned this Jul 6, 2022
@codecov
Copy link

codecov bot commented Jul 6, 2022

Codecov Report

Merging #449 (9d0ed50) into main (b9fa8be) will decrease coverage by 0.20%.
The diff coverage is 42.18%.

@@            Coverage Diff             @@
##             main     #449      +/-   ##
==========================================
- Coverage   70.77%   70.56%   -0.21%     
==========================================
  Files          46       47       +1     
  Lines        8150     8208      +58     
==========================================
+ Hits         5768     5792      +24     
- Misses       2113     2145      +32     
- Partials      269      271       +2     
Flag Coverage Δ
tests 70.56% <42.18%> (-0.21%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cmd/terramate/cli/cli.go 5.25% <0.00%> (-0.15%) ⬇️
stack/create.go 73.03% <50.00%> (-1.67%) ⬇️
test/stack.go 75.00% <75.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b9fa8be...9d0ed50. Read the comment docs.

@katcipis katcipis marked this pull request as ready for review July 6, 2022 12:36
@katcipis katcipis requested a review from i4ki July 6, 2022 12:36
Copy link
Contributor

@i4ki i4ki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@katcipis katcipis merged commit a077cef into main Jul 6, 2022
@katcipis katcipis deleted the katcipis-add-terramate-create branch July 6, 2022 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants