Skip to content

Commit

Permalink
disable aws
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Feb 20, 2024
1 parent b48b7c7 commit b7b4f30
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/main/java/com/rultor/agents/Agents.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,17 +263,19 @@ public Agent agent(final Talk talk, final Profile profile)
new QnSafe(question)
),
new StartsRequest(profile),
new StartsInstance(
new AwsEc2Image(
new AwsEc2(
Manifests.read("Rultor-EC2Key"),
Manifests.read("Rultor-EC2Secret")
new Agent.Disabled(
new StartsInstance(
new AwsEc2Image(
new AwsEc2(
Manifests.read("Rultor-EC2Key"),
Manifests.read("Rultor-EC2Secret")
),
Manifests.read("Rultor-EC2Image")
),
Manifests.read("Rultor-EC2Image")
),
profile,
Agents.PORT, Agents.LOGIN,
Agents.priv()
profile,
Agents.PORT, Agents.LOGIN,
Agents.priv()
)
),
new RegistersShell(
profile,
Expand Down Expand Up @@ -305,10 +307,12 @@ public Agent agent(final Talk talk, final Profile profile)
new ReleaseBinaries(this.github, profile),
new Dephantomizes(this.github),
new Reports(this.github),
new StopsInstance(
new AwsEc2(
Manifests.read("Rultor-EC2Key"),
Manifests.read("Rultor-EC2Secret")
new Agent.Disabled(
new StopsInstance(
new AwsEc2(
Manifests.read("Rultor-EC2Key"),
Manifests.read("Rultor-EC2Secret")
)
)
),
new RemovesShell(),
Expand Down
27 changes: 27 additions & 0 deletions src/main/java/com/rultor/spi/Agent.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,31 @@ public void execute(final Talk talk) throws IOException {
}
}

/**
* Disabled.
*
* @since 1.0
*/
@Immutable
@ToString
@EqualsAndHashCode(of = "agent")
final class Disabled implements Agent {
/**
* Agent to disable.
*/
private final transient Agent agent;

/**
* Ctor.
* @param agt Agent
*/
public Disabled(final Agent agt) {
this.agent = agt;
}

@Override
public void execute(final Talk talk) throws IOException {
// nothing to do
}
}
}

0 comments on commit b7b4f30

Please sign in to comment.