Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
enedis_sge_konnector
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
LLLE_Project
enedis_sge_konnector
Commits
09929480
Commit
09929480
authored
2 years ago
by
Hugo SUBTIL
Browse files
Options
Downloads
Patches
Plain Diff
update manifest + cicd
parent
c259724c
No related branches found
Branches containing commit
No related tags found
1 merge request
!6
Feat/get consumption data
Pipeline
#28471
passed
2 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+53
-2
53 additions, 2 deletions
.gitlab-ci.yml
manifest.konnector
+11
-1
11 additions, 1 deletion
manifest.konnector
src/index.js
+17
-20
17 additions, 20 deletions
src/index.js
with
81 additions
and
23 deletions
.gitlab-ci.yml
+
53
−
2
View file @
09929480
...
...
@@ -6,8 +6,59 @@
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
stages
:
-
test
-
test
-
build
-
publish
sast
:
stage
:
test
include
:
-
template
:
Security/SAST.gitlab-ci.yml
-
template
:
Security/SAST.gitlab-ci.yml
build-dev
:
image
:
${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/node:16.14.2-alpine3.14
stage
:
build
before_script
:
-
apk add git
-
apk add bash
script
:
-
yarn
-
yarn build-dev
-
git config --global user.name build-pipeline
-
git config --global user.email "$GIT_USER"
-
git config --global user.password "$GIT_PWD"
-
git config user.email "$GIT_USER"
-
git remote set-url origin https://"$GIT_USER":"$GIT_PWD"@forge.grandlyon.com/llle_project/enedis-sge-konnector.git
-
git config --global credential.helper store
-
yarn deploy-dev
only
:
-
dev
build
:
image
:
${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/node:16.14.2-alpine3.14
stage
:
build
before_script
:
-
apk add git
-
apk add bash
script
:
-
yarn
-
yarn build
-
git config --global user.name build-pipeline
-
git config --global user.email "$GIT_USER"
-
git config --global user.password "$GIT_PWD"
-
git config user.email "$GIT_USER"
-
git remote set-url origin https://"$GIT_USER":"$GIT_PWD"@forge.grandlyon.com/web-et-numerique/llle_project/enedis-sge-konnector.git
-
git config --global credential.helper store
-
yarn deploy
only
:
-
master
publish
:
stage
:
publish
before_script
:
-
apk add git
script
:
-
yarn cozyPublish
only
:
-
tags
when
:
manual
This diff is collapsed.
Click to expand it.
manifest.konnector
+
11
−
1
View file @
09929480
...
...
@@ -11,6 +11,15 @@
"categories": ["energy"],
"frequency": "daily",
"fields": {
"wso2BaseUrl": {
"type": "hidden"
},
"loginUtilisateur": {
"type": "hidden"
},
"apiToken": {
"type": "hidden"
},
"pdl": {
"type": "text"
},
...
...
@@ -26,7 +35,8 @@
"screenshots": [],
"permissions": {
"accounts": {
"type": "io.cozy.accounts"
"type": "io.cozy.accounts",
"verbs": ["GET"]
},
"enedis data": {
"type": "com.grandlyon.enedis.*"
...
...
This diff is collapsed.
Click to expand it.
src/index.js
+
17
−
20
View file @
09929480
...
...
@@ -134,16 +134,7 @@ async function getData(url, apiAuthKey, userLogin, pointId) {
apikey
:
apiAuthKey
,
}
// If start date exceed the maximum amount of data we can get with one query
// get only 24 month
if
(
moment
(
endDate
).
diff
(
startDailyDate
,
'
months
'
,
true
)
>
24
)
{
log
(
'
info
'
,
'
Start date exceed 24 month, setting start date to current date minus 24 month
'
)
startDailyDate
=
moment
(
endDate
).
subtract
(
24
,
'
month
'
)
startDailyDateString
=
startDailyDate
.
format
(
'
YYYY-MM-DD
'
)
}
setStartDate
()
const
{
response
}
=
await
soapRequest
({
url
:
url
,
...
...
@@ -185,16 +176,7 @@ async function getMaxPowerData(url, apiAuthKey, userLogin, pointId) {
apikey
:
apiAuthKey
,
}
// If start date exceed the maximum amount of data we can get with one query
// get only 24 month
if
(
moment
(
endDate
).
diff
(
startDailyDate
,
'
months
'
,
true
)
>
24
)
{
log
(
'
info
'
,
'
Start date exceed 24 month, setting start date to current date minus 24 month
'
)
startDailyDate
=
moment
(
endDate
).
subtract
(
24
,
'
month
'
)
startDailyDateString
=
startDailyDate
.
format
(
'
YYYY-MM-DD
'
)
}
setStartDate
()
const
{
response
}
=
await
soapRequest
({
url
:
url
,
...
...
@@ -217,6 +199,21 @@ async function getMaxPowerData(url, apiAuthKey, userLogin, pointId) {
)
}
/**
* If start date exceed the maximum amount of data we can get with one query
* get only 36 month
*/
function
setStartDate
()
{
if
(
moment
(
endDate
).
diff
(
startDailyDate
,
'
months
'
,
true
)
>
36
)
{
log
(
'
info
'
,
'
Start date exceed 36 month, setting start date to current date minus 36 month
'
)
startDailyDate
=
moment
(
endDate
).
subtract
(
36
,
'
month
'
)
startDailyDateString
=
startDailyDate
.
format
(
'
YYYY-MM-DD
'
)
}
}
/**
* Get half-hour data
* @param {string} url
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment