Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #13 from v1v/feature/add-labels
Browse files Browse the repository at this point in the history
Extra tags with more metadata
  • Loading branch information
adam-stokes authored Apr 22, 2022
2 parents 6d0002f + fae3c71 commit 8767c7b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ogc/provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,13 @@ def create(self, layout, env, **kwargs) -> db.Node:
now = datetime.datetime.utcnow().strftime("created-%Y-%m-%d")
layout["tags"].append(now)
layout["tags"].append(f"user-{user.slug}")
tags["Created"] = now
tags["UserTag"] = f"user-{user.slug}"
tags["created"] = now
tags["user_tag"] = f"user-{user.slug}"
# Store some extra metadata similar to what other projects use
epoch = datetime.datetime.now().timestamp()
tags["created_date"] = epoch
tags["environment"] = "ogc"
tags["repo"] = "ogc"

node = self._create_node(**opts)
self.provisioner.ex_create_tags(self.node(instance_id=node.instance_id), tags)
Expand Down

0 comments on commit 8767c7b

Please sign in to comment.