Skip to content
Snippets Groups Projects
.gitlab-ci.yml 2.00 KiB
image: python:3-alpine

actualisation_dois:

  only:
    - schedules
    - web

  before_script:
    - apk update
    - apk add git openssh
  script:
#    - pip install pandas
#    - pip install requests
#    - pip install matplotlib
#    - python run-all-codes.py
  after_script:
    - pwd
    - ls -a
    - git config user.name "${GITLAB_USER_NAME}"
    - git config user.email "${GITLAB_USER_EMAIL}"
    - git remote set-url --push origin "https://PUSH_TOKEN:${ACCESS_TOKEN}@gricad-gitlab.univ-grenoble-alpes.fr/${CI_PROJECT_PATH}.git"
    - git add -f dois-uga.csv 2-produce-graph/hist-evol-datasets-per-repo.png 2-produce-graph/hist-quantity-year-type.png 2-produce-graph/pie--datacite-client.png 2-produce-graph/pie--datacite-type.png 1-enrich-with-datacite/all_datacite_clients_for_uga.csv 1-enrich-with-datacite/nb-dois.txt
    - git commit -m "Execution du pipeline. Actualisation des dois et des graphes."
    - git remote -v
    - echo ${CI_COMMIT_REF_NAME}
    - git push origin HEAD:${CI_COMMIT_REF_NAME}

    - cd ..
    - git clone ${LINK_TO_CLONE}
    - ls -a
    - pwd
    - cp open-research-data-monitor-back/1-enrich-with-datacite/nb-dois.txt ${PATH_TO_PUSH}
    - cd ${PATH_TO_PUSH}
    - pwd
    - ls -a
    - git config user.name "${GITLAB_USER_NAME}"
    - git config user.email "${GITLAB_USER_EMAIL}"
    - git remote set-url --push origin "https://PUSH_TOKEN2:${ACCESS_TOKEN2}@gricad-gitlab.univ-grenoble-alpes.fr/${PROJECT_PATH2}.git"
    - echo ${ACCESS_TOKEN2}
    - echo ${ACCESS_TOKEN}
    - git add -f nb-dois.txt
    - git commit -m "Execution du pipeline. Actualisation du nombre de dois."
    - git remote -v
    - git status
    - git push origin HEAD
  
  artifacts:
    paths:
      - dois-uga.csv
      - 2-produce-graph/hist-evol-datasets-per-repo.png
      - 2-produce-graph/hist-quantity-year-type.png
      - 2-produce-graph/pie--datacite-client.png
      - 2-produce-graph/pie--datacite-type.png
      - 1-enrich-with-datacite/nb-dois.txt
      - 1-enrich-with-datacite/all_datacite_clients_for_uga.csv