Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
eladb committed Mar 21, 2024
1 parent 9dc0481 commit 53f4835
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 21 deletions.
9 changes: 6 additions & 3 deletions containers/ecr.main.w
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
bring "./tfaws-ecr.w" as ecr;
bring "./utils.w" as utils;
bring util;

class Extern {
pub static extern "./utils.js" dirname(): str;
}

if util.env("WING_TARGET") == "tf-aws" {
new ecr.Repository(
name: "my-repository",
directory: utils.dirname() + "/test/my-app",
directory: Extern.dirname() + "/test/my-app",
tag: "tag1"
);
);
}

7 changes: 0 additions & 7 deletions containers/utils.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
exports.entrypointDir = function (scope) {
if (typeof(scope.entrypointDir) == "string") {
return scope.entrypointDir;
}

return exports.entrypointDir(scope.node.scope);
};

exports.dirname = function() {
return __dirname;
Expand Down
6 changes: 0 additions & 6 deletions containers/utils.w

This file was deleted.

1 change: 0 additions & 1 deletion containers/values.w
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
bring util;
bring fs;
bring "./utils.w" as utils;

pub class Values {
pub static all(): Map<str> {
Expand Down
1 change: 0 additions & 1 deletion containers/workload.sim.w
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ bring cloud;
bring sim;
bring ui;
bring "./api.w" as api;
bring "./utils.w" as utils;

pub class Workload_sim {
pub publicUrl: str?;
Expand Down
3 changes: 1 addition & 2 deletions containers/workload.tfaws.w
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ bring "cdk8s-plus-27" as plus;
bring "cdk8s" as cdk8s;
bring "cdktf" as cdktf;
bring "./tfaws-ecr.w" as ecr;
bring "./utils.w" as utils;
bring "@cdktf/provider-kubernetes" as k8s;
bring "@cdktf/provider-helm" as helm;
bring fs;
Expand All @@ -21,7 +20,7 @@ pub class Workload_tfaws {

if this.isPath(props.image) {
let hash = this.resolveContentHash(props) ?? props.image;
let appDir = utils.entrypointDir(this);
let appDir = nodeof(this).app.entrypointDir;
let repository = new ecr.Repository(
name: props.name,
directory: appDir + "/" + props.image,
Expand Down
1 change: 0 additions & 1 deletion containers/workload.w
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ bring util;
bring "./workload.sim.w" as sim;
bring "./workload.tfaws.w" as tfaws;
bring "./api.w" as api;
bring "./utils.w" as utils;

bring http;

Expand Down

0 comments on commit 53f4835

Please sign in to comment.