Skip to content

Commit

Permalink
ADD: mise à jour de JobConfig.java
Browse files Browse the repository at this point in the history
  • Loading branch information
slemaire777 committed Sep 5, 2024
1 parent fa2760a commit e0a4fb3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-test-pubtodockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:
with:
images: ${{ env.DOCKERHUB_IMAGE_PREFIX }}
- name: "Push: login to DockerHub"
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/test' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/restoration_batch_initial' || startsWith(github.ref, 'refs/tags/'))
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/test' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/'))
run: |
echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: "Push: push docker image"
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/test' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/restoration_batch_initial' || startsWith(github.ref, 'refs/tags/'))
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/test' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/'))
run: |
DOCKER_TAGS="${{ steps.docker_tag_meta.outputs.tags }}"
for DOCKER_TAG in $DOCKER_TAGS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@ public class JobConfig {
@Value("${table.name}")
private String nomTable;


}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package fr.abes.theses_batch_indexation.utils;

import fr.abes.theses_batch_indexation.configuration.JobConfig;
import fr.abes.theses_batch_indexation.database.TableIndexationES;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
Expand All @@ -13,17 +15,8 @@
@Getter
public class MappingJobName {

@Value("${index.name.theses}")
private String theses;

@Value("${index.name.personnes}")
private String personnes;

@Value("${index.name.thematiques}")
private String thematiques;

@Value("${index.name.recherche_personnes}")
private String recherche_personnes;
@Autowired
JobConfig jobConfig;

private final NomIndexSelecteur nomIndexSelecteur;
private final Environment env;
Expand Down Expand Up @@ -54,18 +47,15 @@ public void init() throws Exception {
nomTableES.put("suppressionThematiquesDansES", TableIndexationES.suppression_es_thematique);

// correspondance nom du job / nom de l'index dans ES
nomIndexES.put("indexationThesesDansES", theses);
nomIndexES.put("suppressionThesesDansES", theses);
nomIndexES.put("indexationPersonnesDansES", personnes);
nomIndexES.put("suppressionPersonnesDansES", personnes);
nomIndexES.put("indexationPersonnesDeBddVersES", personnes);
nomIndexES.put("ajoutPersonnesDansES", personnes);
nomIndexES.put("ajoutRecherchePersonnesDansES", recherche_personnes);
nomIndexES.put("indexationRecherchePersonnesDansES", recherche_personnes);
nomIndexES.put("indexationRecherchePersonnesDeBddVersES", recherche_personnes);
nomIndexES.put("suppressionRecherchePersonnesDansES", recherche_personnes);
nomIndexES.put("indexationThematiquesDansES", thematiques);
nomIndexES.put("suppressionThematiquesDansES", thematiques);
nomIndexES.put("indexationThesesDansES", jobConfig.getThesesIndex());
nomIndexES.put("suppressionThesesDansES", jobConfig.getThesesIndex());
nomIndexES.put("indexationPersonnesDansES", jobConfig.getPersonnesIndex());
nomIndexES.put("indexationPersonnesDeBddVersES", jobConfig.getPersonnesIndex());
nomIndexES.put("indexationThematiquesDansES", jobConfig.getThematiquesIndex());
nomIndexES.put("suppressionThematiquesDansES", jobConfig.getThematiquesIndex());
nomIndexES.put("indexationRecherchePersonnesDansES", jobConfig.getRecherche_personnesIndex());
nomIndexES.put("indexationRecherchePersonnesDeBddVersES", jobConfig.getRecherche_personnesIndex());


// correspondance nom du job / nom de l'index dans ES
nomAliasES.put("indexationPersonnesDansES", "personnes_alias");
Expand All @@ -82,4 +72,4 @@ public void init() throws Exception {
nomIndexES.replace(env.getProperty("spring.batch.job.names"), indexSuivant);
}
}
}
}

0 comments on commit e0a4fb3

Please sign in to comment.