Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve pending issues of the release pipeline #1133

Merged
merged 7 commits into from
May 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 git@github.com:tardis-sn/tardis.git out
cd out

git config --local user.name "Azure Pipelines"
git config --local user.email "azuredevops@microsoft.com"
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