diff --git a/data-collectors/spreadsheets-google/.env.example b/data-collectors/spreadsheets-google/.env.example index 360d0ab28..e0a05d55b 100644 --- a/data-collectors/spreadsheets-google/.env.example +++ b/data-collectors/spreadsheets-google/.env.example @@ -30,4 +30,7 @@ clientId=odh-mobility-datacollector VENDOR=staEcharging BASE_URI=https://mobility.share.opendatahub.testingmachine.eu/json LOG_LEVEL=debug -LOG_STYLE=json \ No newline at end of file +LOG_STYLE=json + +google.auth.client_secret_location=file:/credentials/client_secret.json +google.auth.credentials_folder=file:/credentials \ No newline at end of file diff --git a/data-collectors/spreadsheets-google/docker-compose.yml b/data-collectors/spreadsheets-google/docker-compose.yml index 450c1fc93..efb028576 100644 --- a/data-collectors/spreadsheets-google/docker-compose.yml +++ b/data-collectors/spreadsheets-google/docker-compose.yml @@ -24,7 +24,8 @@ services: - 9000:9000 - 9001:9001 volumes: - - ~/.m2/:/var/maven/.m2:Z + - ~/.m2/:/var/maven/.m2 - ./:/code + - ./credentials:/credentials working_dir: /code tty: true diff --git a/data-collectors/spreadsheets-google/infrastructure/ansible/deploy.yml b/data-collectors/spreadsheets-google/infrastructure/ansible/deploy.yml index c01d4feb1..1552511ad 100644 --- a/data-collectors/spreadsheets-google/infrastructure/ansible/deploy.yml +++ b/data-collectors/spreadsheets-google/infrastructure/ansible/deploy.yml @@ -17,3 +17,5 @@ remote: docker-compose.yml - local: ../../.env remote: .env + - local: ../../credentials + remote: credentials diff --git a/data-collectors/spreadsheets-google/infrastructure/docker-compose.run.yml b/data-collectors/spreadsheets-google/infrastructure/docker-compose.run.yml index ea6dd44ed..ad5f5c42f 100644 --- a/data-collectors/spreadsheets-google/infrastructure/docker-compose.run.yml +++ b/data-collectors/spreadsheets-google/infrastructure/docker-compose.run.yml @@ -10,3 +10,5 @@ services: - .env ports: - ${SERVER_PORT}:8080 + volumes: + - ./credentials:/credentials diff --git a/data-collectors/spreadsheets-google/src/main/java/it/bz/odh/spreadsheets/services/GoogleAuthenticator.java b/data-collectors/spreadsheets-google/src/main/java/it/bz/odh/spreadsheets/services/GoogleAuthenticator.java index 6c4ba2c63..cd6c093ae 100644 --- a/data-collectors/spreadsheets-google/src/main/java/it/bz/odh/spreadsheets/services/GoogleAuthenticator.java +++ b/data-collectors/spreadsheets-google/src/main/java/it/bz/odh/spreadsheets/services/GoogleAuthenticator.java @@ -35,11 +35,11 @@ @Service public abstract class GoogleAuthenticator { - @Value("classpath:/META-INF/spring/client_secret.json") + @Value("${google.auth.client_secret_location}") private Resource clientSecret; private NetHttpTransport HTTP_TRANSPORT; private JsonFactory JSON_FACTORY = GsonFactory.getDefaultInstance(); - @Value("classpath:META-INF/credentials") + @Value("${google.auth.credentials_folder}") private Resource credentialsFolder; protected Credential getCredentials() throws IOException { diff --git a/data-collectors/spreadsheets-google/src/main/resources/META-INF/credentials/.gitignore b/data-collectors/spreadsheets-google/src/main/resources/META-INF/credentials/.gitignore deleted file mode 100644 index f5e4a7eea..000000000 --- a/data-collectors/spreadsheets-google/src/main/resources/META-INF/credentials/.gitignore +++ /dev/null @@ -1 +0,0 @@ -StoredCredential