-
Notifications
You must be signed in to change notification settings - Fork 24
yandex-devtools commits during 1,5 of using this plugin #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
frizzlywitch
wants to merge
24
commits into
yandex-qatools:master
Choose a base branch
from
frizzlywitch:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
143db4b
Set server url and agent name to metadata
7ad096e
Set agent name from OpenStack VM name
94506ae
upped teamcity version, 9.0 -> 9.1
bogdad 7b66352
upped teamcity version, 9.0 -> 9.1, cc
bogdad dd9c664
upped teamcity version, 9.0 -> 9.1, added missing overrides
bogdad 3c76667
returning name from agent description
bogdad c242175
cloudlistener
bogdad f2ed126
cloudlistener
bogdad cbce4a9
cloudlistener, possible nullpointer fix
bogdad ee14d4a
cloudlistener, possible nullpointer fix, 2
bogdad 2755200
removing cloud listener
bogdad 44a0201
removing bogus agent name
bogdad 0662851
removing unneeded dependency
bogdad c0b44ba
removing unneeded dependency, cc
bogdad 51cdf67
Merge pull request #1 from bogdad/master
9276aec
up teamcity version
13d8e53
Makefile
73ce685
extend public api
41cfb4e
Merge pull request #2 from frizzlywitch/master
988f40d
Merge remote-tracking branch 'upstream/master'
ae6453b
Merge pull request #4 from aefimov/master
3ed5aa8
Merge remote-tracking branch 'upstream/master'
8a308ea
Merge pull request #5 from aefimov/master
3c7f276
update teamcity to 2017.1.1
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
TEAMCITY_VERSION=10.0.3 | ||
|
||
|
||
all: | ||
|
||
tsinstall: | ||
apt-get install teamcity-server | ||
|
||
deps: | ||
mvn install:install-file -Dfile=/usr/local/teamcity-10.0.3/webapps/ROOT/WEB-INF/lib/cloud-interface.jar -DgroupId=jetbrains.buildServer.clouds -DartifactId=cloud-interface -Dversion=10.0.3 -Dpackaging=jar | ||
mvn install:install-file -Dfile=/usr/local/teamcity-10.0.3/webapps/ROOT/WEB-INF/lib/cloud-shared.jar -DgroupId=jetbrains.buildServer.clouds -DartifactId=cloud-shared -Dversion=10.0.3 -Dpackaging=jar | ||
|
||
pure_build: | ||
mvn clean package | ||
|
||
build: tsinstall deps pure_build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,14 +21,15 @@ | |
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
|
||
public class OpenstackAgentProperties extends AgentLifeCycleAdapter { | ||
public class OpenstackAgentPropertiesReader extends AgentLifeCycleAdapter { | ||
@NotNull private static final Logger LOG = Loggers.AGENT; | ||
@NotNull private final String metadataUrl = "http://169.254.169.254/openstack/latest/meta_data.json"; | ||
@NotNull private final BuildAgentConfigurationEx agentConfiguration; | ||
|
||
public OpenstackAgentProperties(@NotNull final BuildAgentConfigurationEx agentConfiguration, @NotNull EventDispatcher<AgentLifeCycleAdapter> dispatcher) { | ||
public OpenstackAgentPropertiesReader(@NotNull final BuildAgentConfigurationEx agentConfiguration, @NotNull EventDispatcher<AgentLifeCycleAdapter> dispatcher) { | ||
this.agentConfiguration = agentConfiguration; | ||
dispatcher.addListener(this); | ||
} | ||
|
@@ -41,6 +42,23 @@ public void afterAgentConfigurationLoaded(@NotNull BuildAgent agent) { | |
|
||
JsonElement metadataElement = new JsonParser().parse(rawMetadata); | ||
|
||
JsonElement teamCityUserData = metadataElement.getAsJsonObject().get("meta"); | ||
Type type = new TypeToken<HashMap<String, String>>() {}.getType(); | ||
HashMap<String,String> customParameters = new Gson().fromJson(teamCityUserData, type); | ||
|
||
if (!customParameters.containsKey(OpenstackCloudParameters.SERVER_URL)) { | ||
LOG.info("Not my OpenStack instance, skipping"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the goal to configure URL & name of TeamCity server ? This informations are provided by cloud process. If it is to use an Openstack agent as classic agent, is it duplicate of #23 ? |
||
return; | ||
} | ||
|
||
for (Map.Entry<String, String> entry : customParameters.entrySet()) { | ||
if (Objects.equals(entry.getKey(), OpenstackCloudParameters.SERVER_URL)) { | ||
agentConfiguration.setServerUrl(entry.getValue()); | ||
} else { | ||
agentConfiguration.addConfigurationParameter(entry.getKey(), entry.getValue()); | ||
} | ||
} | ||
|
||
String uuid = metadataElement.getAsJsonObject().get("uuid").getAsString(); | ||
if (uuid != null) { | ||
LOG.info(String.format("Setting %s to %s", OpenstackCloudParameters.OPENSTACK_INSTANCE_ID, uuid)); | ||
|
@@ -49,17 +67,9 @@ public void afterAgentConfigurationLoaded(@NotNull BuildAgent agent) { | |
|
||
String name = metadataElement.getAsJsonObject().get("name").getAsString(); | ||
if (name != null) { | ||
LOG.info(String.format("Setting name to %s", name)); | ||
agentConfiguration.setName(name); | ||
} | ||
|
||
JsonElement teamCityUserData = metadataElement.getAsJsonObject().get("meta"); | ||
Type type = new TypeToken<HashMap<String, String>>() {}.getType(); | ||
HashMap<String,String> customParameters = new Gson().fromJson(teamCityUserData, type); | ||
for (Map.Entry<String, String> entry : customParameters.entrySet()) { | ||
agentConfiguration.addConfigurationParameter(entry.getKey(), entry.getValue()); | ||
} | ||
|
||
LOG.info(String.format("Setting %s to %s", OpenstackCloudParameters.AGENT_CLOUD_TYPE, OpenstackCloudParameters.CLOUD_TYPE)); | ||
agentConfiguration.addConfigurationParameter(OpenstackCloudParameters.AGENT_CLOUD_TYPE, OpenstackCloudParameters.CLOUD_TYPE); | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a real interest adding a
Makefile
for the build process ?