Skip to content

Commit

Permalink
Solve pending issues of the release pipeline (tardis-sn#1133)
Browse files Browse the repository at this point in the history
* Initial commit

* Use PAT to clone tardis_zenodo repo

* Automatic push zenodo.json when changes

* Automatic push zenodo.json when changes #2

* Automatic push zenodo.json when changes #3

* Deactivate PR trigger

* Change `@misc` for `@software` in citations (zenodo)
  • Loading branch information
epassaro authored May 7, 2020
1 parent 0e085f0 commit 52674df
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ The following bibtex entries are needed for the references.
}
@misc{kerzendorf_wolfgang_2019_2590539,
@software{kerzendorf_wolfgang_2019_2590539,
author = {Kerzendorf, Wolfgang and
Nöbauer, Ulrich and
Sim, Stuart and
Expand Down
45 changes: 38 additions & 7 deletions azure-pipelines/release-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ schedules:
variables:
system.debug: "true"
tardis.zenodo.home: "$(Agent.BuildDirectory)/tardis_zenodo"
tardis.zenodo.access: $(epassaro_pat)
tardis.build.dir: $(Build.Repository.LocalPath)

pool:
Expand All @@ -25,6 +26,17 @@ jobs:
- job: zenodo_json
displayName: Create Zenodo JSON file
steps:

- task: DownloadSecureFile@1
inputs:
secureFile: 'id_azure_rsa'

- task: InstallSSHKey@0
inputs:
knownHostsEntry: $(gh_host)
sshPublicKey: $(public_key)
sshKeySecureFile: 'id_azure_rsa'

- task: DownloadSecureFile@1
name: zenodoSecretKey
displayName: "Download Zenodo secret key"
Expand Down Expand Up @@ -54,12 +66,10 @@ jobs:
conda install jupyter nbconvert numpy pandas orcid -c conda-forge --yes
displayName: "Create Zenodo env"
# Actually this is a workaround. We need to grab this from `tardis_zenodo` private repo.
- bash: |
cd ..; mkdir tardis_zenodo
cd $(tardis.zenodo.home)
wget https://gist.githubusercontent.com/epassaro/12364cd3b33e4b2923ff1861d80ef6d8/raw/d71ca46ca1816f6f46c768314c2da59ed017861e/gather_data.ipynb
displayName: "Downloading notebook (workaround)"
cd ..
git clone https://$(tardis.zenodo.access)@github.com/tardis-sn/tardis_zenodo.git
displayName: "Clone tardis_zenodo repo"
- bash: |
cp $(zenodoSecretKey.secureFilePath) $(tardis.zenodo.home)
Expand All @@ -80,9 +90,30 @@ jobs:
displayName: "Running notebook (not allow errors)"
# This step should fail if there are changes in .zenodo.json
#- bash: |
# diff $(tardis.zenodo.home)/.zenodo.json .zenodo.json
# displayName: "Look for changes in JSON"

- bash: |
diff $(tardis.zenodo.home)/.zenodo.json .zenodo.json
displayName: "Look for changes in JSON"
set -e
cd ..
git clone [email protected]:tardis-sn/tardis.git out
cd out
git config --local user.name "Azure Pipelines"
git config --local user.email "[email protected]"
cp $(tardis.zenodo.home)/.zenodo.json .zenodo.json
git add .zenodo.json
if git diff --staged --quiet; then
echo "Exiting with no changes"
exit 0
else
git commit -m "Update zenodo.json"
git push origin master
fi
displayName: "Push zenodo.json to master branch"
- task: PublishPipelineArtifact@1
inputs:
Expand Down
2 changes: 1 addition & 1 deletion docs/credits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ The following bibtex entries are needed for the references.
}
@misc{kerzendorf_wolfgang_2019_2590539,
@software{kerzendorf_wolfgang_2019_2590539,
author = {Kerzendorf, Wolfgang and
Nöbauer, Ulrich and
Sim, Stuart and
Expand Down

0 comments on commit 52674df

Please sign in to comment.