Skip to content

Commit

Permalink
Expose deployster version in "_version" context variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Arik Kfir committed Dec 3, 2017
1 parent 8ad231c commit 7003095
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/QUICK-START.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ cd deployster/examples
Now lets run one of the manifests:

```bash
../deployster.sh --var deployster_version=latest ./cluster.yaml
../deployster.sh ./cluster.yaml
```

## Notes
Expand Down
8 changes: 4 additions & 4 deletions examples/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugs:
resources:

test-cluster:
type: infolinks/deployster-gcp-gke-cluster:{{ deployster_version }}
type: infolinks/deployster-gcp-gke-cluster:{{ _version }}
dependencies:
project: test-project
config:
Expand All @@ -21,7 +21,7 @@ resources:
preemptible: true

cluster-admin-role:
type: infolinks/deployster-k8s-rbac-role:{{ deployster_version }}
type: infolinks/deployster-k8s-rbac-role:{{ _version }}
readonly: true
dependencies:
cluster: test-cluster
Expand All @@ -37,12 +37,12 @@ resources:
verbs: ['*']

test-administrator-user:
type: infolinks/deployster-k8s-rbac-user:{{ deployster_version }}
type: infolinks/deployster-k8s-rbac-user:{{ _version }}
config:
name: {{ test_admin_user }}

test-administrator-binding:
type: infolinks/deployster-k8s-rbac-role-binding:{{ deployster_version }}
type: infolinks/deployster-k8s-rbac-role-binding:{{ _version }}
dependencies:
role: cluster-admin-role
user: test-administrator-user
Expand Down
2 changes: 1 addition & 1 deletion examples/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugs:
resources:

test-project:
type: infolinks/deployster-gcp-project:{{ deployster_version }}
type: infolinks/deployster-gcp-project:{{ _version }}
config:
project_id: {{ gcp_project }}
organization_id: {{ organization_id }}
Expand Down
2 changes: 1 addition & 1 deletion examples/run-example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ echo "Building..." >&2
$(dirname $0)/../.buildkite/build.sh ${VERSION} 2>&1 1>> ./.build.log
[[ $? != 0 ]] && echo "Build failed! (inspect '.build.log' for details)" >&2 && exit 1

DEPLOYSTER_VERSION=${VERSION} source $(dirname $0)/../deployster.sh --no-pull --var deployster_version=0.0.0 $@
source $(dirname $0)/../deployster.sh --no-pull $@
2 changes: 1 addition & 1 deletion examples/sql.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resources:

test-sql:
type: infolinks/deployster-gcp-cloud-sql:{{ deployster_version }}
type: infolinks/deployster-gcp-cloud-sql:{{ _version }}
dependencies:
project: test-project
config:
Expand Down
1 change: 1 addition & 0 deletions src/deployster.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@ def main():
log('')

context: Context = Context()
context.add_variable("_version", version)
for file in os.listdir(os.path.expanduser('~/.deployster')):
if re.match(r'^vars\.(.*\.)?auto\.yaml$', file):
context.add_file(os.path.expanduser('~/.deployster/' + file))
Expand Down

0 comments on commit 7003095

Please sign in to comment.