Skip to content

Commit

Permalink
Fixed a few bugs in the gradle setup for rfs
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Helma <chelma+github@amazon.com>
  • Loading branch information
chelma committed Jun 19, 2024
1 parent 5c9e7f1 commit 0a4c31d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
7 changes: 3 additions & 4 deletions RFS/build-preloaded-source-image.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ def createNetworkTask = task createNetwork(type: Exec) {
}
task createInitialElasticsearchContainer(type: DockerCreateContainer) {
dependsOn createNetwork, buildDockerImage_emptyElasticsearchSource_7_17
targetImageId 'migrations/emptyElasticsearchSource_7_17:latest'
targetImageId 'migrations/empty_elasticsearch_source_7_17:latest'
containerName = "elasticsearch-${uniqueId}"
hostConfig.network = myNetworkName
hostConfig.dns = ['elasticsearch']
networkAliases = ['elasticsearch']
hostName = 'elasticsearch'
}
Expand Down Expand Up @@ -64,14 +63,14 @@ def sourceContainerCommitTask = task commitSourceContainer() {
def containerId = createInitialElasticsearchContainer.getContainerId().get()

client.commitCmd(containerId)
.withRepository("elasticsearch_rfs_source")
.withRepository("migrations/elasticsearch_rfs_source")
.withTag("latest")
.exec()
}
}

task removeClientContainer(type: DockerRemoveContainer) {
dependsOn waitClientContainer
dependsOn commitSourceContainer
targetContainerId createClientContainer.getContainerId()
}
startClientTask.finalizedBy(removeClientContainer)
Expand Down
3 changes: 2 additions & 1 deletion RFS/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ dependencies {
}

application {
mainClassName = 'com.rfs.ReindexFromSnapshot'
mainClassName = 'com.rfs.RfsMigrateDocuments'
}

task runRfsWorker (type: JavaExec) {
Expand Down Expand Up @@ -180,6 +180,7 @@ task buildDockerImages {
for (dockerService in dockerServices) {
dependsOn "buildDockerImage_${dockerService.projectName}"
}
dependsOn buildDockerImage_elasticsearchRFSSource
}

tasks.named("buildDockerImage_elasticsearchRFSSource") {
Expand Down
6 changes: 3 additions & 3 deletions RFS/docker/TestSource_ES_7_17/container-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

echo "Setting AWS Creds from ENV Variables"
bin/elasticsearch-keystore create
echo $AWS_ACCESS_KEY_ID | bin/elasticsearch-keystore add s3.client.default.access_key --stdin
echo $AWS_SECRET_ACCESS_KEY | bin/elasticsearch-keystore add s3.client.default.secret_key --stdin
echo $AWS_ACCESS_KEY_ID | bin/elasticsearch-keystore add --stdin s3.client.default.access_key --force
echo $AWS_SECRET_ACCESS_KEY | bin/elasticsearch-keystore add --stdin s3.client.default.secret_key --force

if [ -n "$AWS_SESSION_TOKEN" ]; then
echo $AWS_SESSION_TOKEN | bin/elasticsearch-keystore add s3.client.default.session_token --stdin
echo $AWS_SESSION_TOKEN | bin/elasticsearch-keystore add --stdin s3.client.default.session_token --force
fi

echo "Starting Elasticsearch"
Expand Down

0 comments on commit 0a4c31d

Please sign in to comment.