Skip to content

Commit

Permalink
Towards Auto API
Browse files Browse the repository at this point in the history
- add Workspace
  • Loading branch information
pawelprazak committed Dec 21, 2023
1 parent 2c8bb73 commit 5233c56
Show file tree
Hide file tree
Showing 12 changed files with 1,002 additions and 9 deletions.
42 changes: 37 additions & 5 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ default:
####################

# Cleans everything
clean-all: clean-json clean-sdk clean-out clean-compiler-plugin clean-codegen clean-scripts clean-test-integration clean-test-templates clean-test-examples clean-test-markdown
clean-all: clean-json clean-sdk clean-auto clean-out clean-compiler-plugin clean-codegen clean-scripts clean-test-integration clean-test-templates clean-test-examples clean-test-markdown

# Compiles everything
compile-all: compile-json compile-sdk compile-codegen compile-compiler-plugin build-language-plugin compile-scripts
compile-all: compile-json compile-sdk compile-auto compile-codegen compile-compiler-plugin build-language-plugin compile-scripts

# Tests everything
test-all: test-json test-sdk test-codegen test-integration test-templates test-examples test-markdown
test-all: test-json test-sdk test-auto test-codegen test-integration test-templates test-examples test-markdown

# Publishes everything locally
publish-local-all: publish-local-json publish-local-sdk publish-local-auto publish-local-codegen publish-local-compiler-plugin install-language-plugin

# Runs all necessary checks before committing
before-commit: compile-all test-all
Expand Down Expand Up @@ -74,7 +77,7 @@ compile-compiler-plugin:
scala-cli --power compile compiler-plugin --suppress-experimental-feature-warning

# Runs tests for core besom SDK
test-core:
test-core: compile-core
@if [ {{ coverage }} = "true" ]; then mkdir -p {{coverage-output-dir-core}}; fi
scala-cli --power test core {{ scala-cli-test-options-core }} --suppress-experimental-feature-warning

Expand Down Expand Up @@ -169,18 +172,47 @@ clean-coverage: clean-sdk
compile-json:
scala-cli --power compile besom-json --suppress-experimental-feature-warning

# Runs tests for json module
test-json:
scala-cli --power test besom-json --suppress-experimental-feature-warning

# Cleans json module
clean-json:
scala-cli --power clean besom-json

# Publishes locally json module
publish-local-json:
scala-cli --power publish local besom-json --project-version {{besom-version}} --suppress-experimental-feature-warning

# Publishes json module
publish-maven-json:
scala-cli --power publish besom-json --project-version {{besom-version}} {{publish-maven-auth-options}}


####################
# Auto
####################

# Compiles auto module
compile-auto: publish-local-core
scala-cli --power compile auto --suppress-experimental-feature-warning

# Runs tests for auto module
test-auto: compile-auto
scala-cli --power test auto --suppress-experimental-feature-warning

# Cleans auto module
clean-auto:
scala-cli --power clean auto

# Publishes locally auto module
publish-local-auto: test-auto
scala-cli --power publish local auto --project-version {{besom-version}} --suppress-experimental-feature-warning

# Publishes auto module
publish-maven-auto: test-auto
scala-cli --power publish auto --project-version {{besom-version}} {{publish-maven-auth-options}}

####################
# Language plugin
####################
Expand Down Expand Up @@ -415,7 +447,7 @@ bump-version new-version:
# Cleans everything, including the local ivy, git untracked files, and kills all java processes
power-wash: clean-all
rm -rf ~/.ivy2/local/org.virtuslab/
git clean -i -d -x
git clean -i -d -x -e ".idea"
killall -9 java
####################
Expand Down
18 changes: 18 additions & 0 deletions auto/project.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//> using scala 3.3.1
//> using options -java-output-version:11 -encoding:utf-8
//> using options -deprecation -feature -Werror -Wunused:all

//> using dep org.virtuslab::besom-json:0.1.1-SNAPSHOT
//> using dep org.virtuslab::besom-core:0.1.1-SNAPSHOT
//> using dep org.virtuslab::scala-yaml:0.0.8

//> using test.dep "org.scalameta::munit:1.0.0-M10"

//> using publish.name "besom-auto"
//> using publish.organization "org.virtuslab"
//> using publish.url "https://github.com/VirtusLab/besom"
//> using publish.vcs "github:VirtusLab/besom"
//> using publish.license "Apache-2.0"
//> using publish.repository "central"
//> using publish.developer "lbialy|Łukasz Biały|https://github.com/lbialy"
//> using publish.developer "pawelprazak|Paweł Prażak|https://github.com/pawelprazak"
13 changes: 13 additions & 0 deletions auto/src/main/scala/besom/auto/Stack.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package besom.auto

/** Stack is an isolated, independently configurable instance of a Pulumi program. Stack exposes methods for the full pulumi lifecycle
* (up/preview/refresh/destroy), as well as managing configuration. Multiple Stacks are commonly used to denote different phases of
* development (such as development, staging and production) or feature branches (such as feature-x-dev, jane-feature-x-dev).
*
* @param workspace
* the workspace associated with the stack
* @param stackName
* the name of the stack
*/
case class Stack(workspace: Workspace, stackName: String)

Loading

0 comments on commit 5233c56

Please sign in to comment.