Add github code push
This commit is contained in:
parent
37d2e6c755
commit
07f8415a88
@ -98,3 +98,37 @@ release-hub:
|
|||||||
- echo "Pushing ${RELTAG}"
|
- echo "Pushing ${RELTAG}"
|
||||||
- docker tag ${SHATAG} ${RELTAG}
|
- docker tag ${SHATAG} ${RELTAG}
|
||||||
- docker push ${RELTAG}
|
- docker push ${RELTAG}
|
||||||
|
|
||||||
|
|
||||||
|
# Send all tags matching vX.Y.Z to github (code and release)
|
||||||
|
push-github:
|
||||||
|
stage: deploy
|
||||||
|
before_script:
|
||||||
|
- apt-get update -qq && apt-get install -y -qq
|
||||||
|
git python3-all-dev git-lfs python3-venv
|
||||||
|
- mkdir ~/.ssh/
|
||||||
|
- cp $RESEARCH_BOT_GH_KEY ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
|
||||||
|
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n\tHostname ssh.github.com\n\tPort 443\n\n" > ~/.ssh/config
|
||||||
|
- git config --global user.email "research.git@nanoporetech.com"
|
||||||
|
- git config --global user.name "ontresearch"
|
||||||
|
script:
|
||||||
|
# Push master and tag to github
|
||||||
|
- git remote add ont ${CI_REPOSITORY_URL} || true
|
||||||
|
- git remote add github git@github.com:epi2me-labs/${CI_PROJECT_NAME}.git || true
|
||||||
|
- git fetch ont dev --tags
|
||||||
|
- git fetch ont master
|
||||||
|
- git fetch github master
|
||||||
|
- git checkout --track github/master || git checkout master
|
||||||
|
- git merge ${CI_COMMIT_TAG}
|
||||||
|
- git push github master
|
||||||
|
- git push github ${CI_COMMIT_TAG}
|
||||||
|
# Make a github release page
|
||||||
|
- python3 -m venv release_env --prompt "(release) "
|
||||||
|
- source release_env/bin/activate
|
||||||
|
- pip install pip --upgrade
|
||||||
|
- pip install git+https://github.com/epi2me-labs/github_release.git
|
||||||
|
- github_release ${CI_PROJECT_NAME} ${CI_COMMIT_TAG} CHANGELOG.md ${RESEARCH_BOT_GH_TOKEN}
|
||||||
|
only:
|
||||||
|
- /^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$/
|
||||||
|
except:
|
||||||
|
- branches
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user