use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.
the class OperatorValidationSteps method createPullSecretForBackup.
@When("create pull secret for backup")
public void createPullSecretForBackup() {
Account aws = AccountsDirectory.getInstance().get(Account.Name.AWS);
OpenShiftUtils.getInstance().createSecret(new SecretBuilder().withNewMetadata().withName(SYNDESIS_BACKUP_SECRET_NAME).endMetadata().withStringData(TestUtils.map("secret-key-id", aws.getProperty("accessKey"), "secret-access-key", aws.getProperty("secretKey"), "region", aws.getProperty("region").toLowerCase().replaceAll("_", "-"), "bucket-name", S3BucketNameBuilder.getBucketName(SYNDESIS_BACKUP_BUCKET_PREFIX))).build());
}
use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.
the class IssueHooksUtils method getGitHubClient.
private static GitHubClient getGitHubClient(Scenario scenario) {
String oauthToken = "";
Optional<Account> optional = AccountsDirectory.getInstance().getAccount(Account.Name.GITHUB);
if (optional.isPresent()) {
if (!optional.get().getProperties().containsKey("PersonalAccessToken")) {
logError(scenario, "Account with name \"GitHub\" and property \"PersonalAccessToken\" is required in credentials.json file.");
logError(scenario, "If you want to get known issues from github in logs in case of scenario fails, update your credentials.");
return null;
} else {
oauthToken = optional.get().getProperty("PersonalAccessToken");
}
}
GitHubClient client = new GitHubClient();
client.setOAuth2Token(oauthToken);
return client;
}
use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.
the class HTTPEndpoints method addAccounts.
public void addAccounts() {
Account http = new Account();
Map<String, String> params = new HashMap<>();
params.put("baseUrl", "http://http-svc:8080");
http.setService("http");
http.setProperties(params);
AccountsDirectory.getInstance().getAccounts().put("http", http);
Account https = new Account();
params = new HashMap<>();
params.put("baseUrl", "https://https-svc:8443");
https.setService("https");
https.setProperties(params);
AccountsDirectory.getInstance().getAccounts().put("https", https);
}
use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.
the class MySQL method deploy.
@Override
public void deploy() {
List<ContainerPort> ports = new LinkedList<>();
ports.add(new ContainerPortBuilder().withName("mysql-cmd").withContainerPort(3306).withProtocol("TCP").build());
List<EnvVar> templateParams = new ArrayList<>();
templateParams.add(new EnvVar("MYSQL_USER", DB_USER, null));
templateParams.add(new EnvVar("MYSQL_PASSWORD", DB_PASSWORD, null));
templateParams.add(new EnvVar("MYSQL_DATABASE", DB_SCHEMA, null));
OpenShiftUtils.getInstance().deploymentConfigs().createOrReplaceWithNew().editOrNewMetadata().withName(APP_NAME).addToLabels(LABEL_NAME, APP_NAME).endMetadata().editOrNewSpec().addToSelector(LABEL_NAME, APP_NAME).withReplicas(1).editOrNewTemplate().editOrNewMetadata().addToLabels(LABEL_NAME, APP_NAME).endMetadata().editOrNewSpec().addNewContainer().withName(APP_NAME).withImage("quay.io/syndesis_qe/mysql-57-centos7").addAllToPorts(ports).addAllToEnv(templateParams).endContainer().endSpec().endTemplate().addNewTrigger().withType("ConfigChange").endTrigger().endSpec().done();
ServiceSpecBuilder serviceSpecBuilder = new ServiceSpecBuilder().addToSelector(LABEL_NAME, APP_NAME);
serviceSpecBuilder.addToPorts(new ServicePortBuilder().withName("mysql-cmd").withPort(3306).withTargetPort(new IntOrString(3306)).build());
OpenShiftUtils.getInstance().services().createOrReplaceWithNew().editOrNewMetadata().withName(APP_NAME).addToLabels(LABEL_NAME, APP_NAME).endMetadata().editOrNewSpecLike(serviceSpecBuilder.build()).endSpec().done();
try {
OpenShiftWaitUtils.waitFor(OpenShiftWaitUtils.areExactlyNPodsReady(LABEL_NAME, APP_NAME, 1));
Thread.sleep(20 * 1000);
} catch (InterruptedException | TimeoutException e) {
log.error("Wait for {} deployment failed ", APP_NAME, e);
}
Account mysqlAccount = new Account();
mysqlAccount.setService("mysql");
Map<String, String> accountParameters = new HashMap<>();
accountParameters.put("url", DB_URL);
accountParameters.put("user", DB_USER);
accountParameters.put("password", DB_PASSWORD);
accountParameters.put("schema", DB_SCHEMA);
mysqlAccount.setProperties(accountParameters);
AccountsDirectory.getInstance().addAccount("mysql", mysqlAccount);
}
use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.
the class SFTP method initProperties.
private void initProperties() {
Account account = AccountsDirectory.getInstance().get(Account.Name.SFTP);
Map<String, String> properties = new HashMap<>();
account.getProperties().forEach((key, value) -> properties.put(key.toLowerCase(), value));
appName = properties.get("host");
sftpPort = Integer.parseInt(properties.get("port"));
userAndPassword = properties.get("username") + ":" + properties.get("password") + ":1500::" + TEST_DIRECTORY;
}
Aggregations