try an automatic release with artifacts
This commit is contained in:
parent
342351e4ad
commit
fd16e4b0c6
147
.gitlab-ci.yml
147
.gitlab-ci.yml
|
@ -1,7 +1,8 @@
|
|||
stages:
|
||||
- test
|
||||
- build
|
||||
- deploy
|
||||
- upload
|
||||
- release
|
||||
|
||||
test:cargo:
|
||||
image: rust:latest
|
||||
|
@ -43,71 +44,103 @@ build:
|
|||
when: never
|
||||
- if: $CI_COMMIT_TAG =~ /^v*/
|
||||
|
||||
# upload:
|
||||
# stage: deploy
|
||||
# image: kroniak/ssh-client
|
||||
# script:
|
||||
# - mkdir -p ~/.ssh
|
||||
# - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
|
||||
# - eval $(ssh-agent -s)
|
||||
# - ssh-add <(echo "$PRIVATE_KEY")
|
||||
# - scp tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz $SERVER_USER@$SERVER_HOST:$LINUX_RELEASE_PATH
|
||||
# - scp tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz.sum $SERVER_USER@$SERVER_HOST:$LINUX_RELEASE_PATH
|
||||
# - scp debian-package/tiempo_${CI_COMMIT_TAG:1}_amd64.deb $SERVER_USER@$SERVER_HOST:$DEBIAN_RELEASE_PATH
|
||||
# - scp tiempo_${CI_COMMIT_TAG:1}_amd64.deb.sum $SERVER_USER@$SERVER_HOST:$DEBIAN_RELEASE_PATH
|
||||
# rules:
|
||||
# - if: $CI_COMMIT_BRANCH
|
||||
# when: never
|
||||
# - if: $CI_COMMIT_TAG =~ /^v*/
|
||||
|
||||
upload:
|
||||
stage: deploy
|
||||
image: kroniak/ssh-client
|
||||
script:
|
||||
- mkdir -p ~/.ssh
|
||||
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
|
||||
- eval $(ssh-agent -s)
|
||||
- ssh-add <(echo "$PRIVATE_KEY")
|
||||
- scp tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz $SERVER_USER@$SERVER_HOST:$LINUX_RELEASE_PATH
|
||||
- scp tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz.sum $SERVER_USER@$SERVER_HOST:$LINUX_RELEASE_PATH
|
||||
- scp debian-package/tiempo_${CI_COMMIT_TAG:1}_amd64.deb $SERVER_USER@$SERVER_HOST:$DEBIAN_RELEASE_PATH
|
||||
- scp tiempo_${CI_COMMIT_TAG:1}_amd64.deb.sum $SERVER_USER@$SERVER_HOST:$DEBIAN_RELEASE_PATH
|
||||
stage: upload
|
||||
image: curlimages/curl:latest
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH
|
||||
when: never
|
||||
- if: $CI_COMMIT_TAG =~ /^v*/
|
||||
|
||||
deploy:arch-bin:
|
||||
stage: deploy
|
||||
image: categulario/makepkg
|
||||
script:
|
||||
# setup ssh
|
||||
- mkdir -p ~/.ssh
|
||||
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
|
||||
- eval $(ssh-agent -s)
|
||||
- ssh-add <(echo "$ARCH_PRIVATE_KEY")
|
||||
# setup git, because we'll commit
|
||||
- git config --global user.name "$COMMITER_NAME"
|
||||
- git config --global user.email "$COMMITER_EMAIL"
|
||||
# finally run the script
|
||||
- scripts/release-aur-bin.sh
|
||||
- |
|
||||
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz ${PACKAGE_REGISTRY_URL}/tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz
|
||||
- |
|
||||
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz.sum ${PACKAGE_REGISTRY_URL}/tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz.sum
|
||||
- |
|
||||
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file debian-package/tiempo_${CI_COMMIT_TAG:1}_amd64.deb ${PACKAGE_REGISTRY_URL}/tiempo_${CI_COMMIT_TAG:1}_amd64.deb
|
||||
- |
|
||||
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file tiempo_${CI_COMMIT_TAG:1}_amd64.deb ${PACKAGE_REGISTRY_URL}/tiempo_${CI_COMMIT_TAG:1}_amd64.deb.sum
|
||||
|
||||
release_job:
|
||||
stage: release
|
||||
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH
|
||||
when: never
|
||||
- if: $CI_COMMIT_TAG =~ /^v*/
|
||||
|
||||
deploy:arch-git:
|
||||
stage: deploy
|
||||
image: categulario/makepkg
|
||||
script:
|
||||
# setup ssh
|
||||
- mkdir -p ~/.ssh
|
||||
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
|
||||
- eval $(ssh-agent -s)
|
||||
- ssh-add <(echo "$ARCH_PRIVATE_KEY")
|
||||
# setup git, because we'll commit
|
||||
- git config --global user.name "$COMMITER_NAME"
|
||||
- git config --global user.email "$COMMITER_EMAIL"
|
||||
# finally run the script
|
||||
- scripts/release-aur-git.sh
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH
|
||||
when: never
|
||||
- if: $CI_COMMIT_TAG =~ /^v*/
|
||||
- echo "running release_job"
|
||||
release:
|
||||
name: 'Release $CI_COMMIT_TAG'
|
||||
description: 'Created using the release-cli'
|
||||
tag_name: '$CI_COMMIT_TAG'
|
||||
ref: '$CI_COMMIT_TAG'
|
||||
|
||||
pages:
|
||||
image: python:3.8-alpine
|
||||
stage: deploy
|
||||
script:
|
||||
- pip install -U sphinx
|
||||
- mkdir -p public/{es,en}
|
||||
- sphinx-build -b html ./docs/es/source/ public/es
|
||||
- sphinx-build -b html ./docs/en/source/ public/en
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
rules:
|
||||
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|
||||
# deploy:arch-bin:
|
||||
# stage: deploy
|
||||
# image: categulario/makepkg
|
||||
# script:
|
||||
# # setup ssh
|
||||
# - mkdir -p ~/.ssh
|
||||
# - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
|
||||
# - eval $(ssh-agent -s)
|
||||
# - ssh-add <(echo "$ARCH_PRIVATE_KEY")
|
||||
# # setup git, because we'll commit
|
||||
# - git config --global user.name "$COMMITER_NAME"
|
||||
# - git config --global user.email "$COMMITER_EMAIL"
|
||||
# # finally run the script
|
||||
# - scripts/release-aur-bin.sh
|
||||
# rules:
|
||||
# - if: $CI_COMMIT_BRANCH
|
||||
# when: never
|
||||
# - if: $CI_COMMIT_TAG =~ /^v*/
|
||||
|
||||
# deploy:arch-git:
|
||||
# stage: deploy
|
||||
# image: categulario/makepkg
|
||||
# script:
|
||||
# # setup ssh
|
||||
# - mkdir -p ~/.ssh
|
||||
# - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
|
||||
# - eval $(ssh-agent -s)
|
||||
# - ssh-add <(echo "$ARCH_PRIVATE_KEY")
|
||||
# # setup git, because we'll commit
|
||||
# - git config --global user.name "$COMMITER_NAME"
|
||||
# - git config --global user.email "$COMMITER_EMAIL"
|
||||
# # finally run the script
|
||||
# - scripts/release-aur-git.sh
|
||||
# rules:
|
||||
# - if: $CI_COMMIT_BRANCH
|
||||
# when: never
|
||||
# - if: $CI_COMMIT_TAG =~ /^v*/
|
||||
|
||||
# pages:
|
||||
# image: python:3.8-alpine
|
||||
# stage: deploy
|
||||
# script:
|
||||
# - pip install -U sphinx
|
||||
# - mkdir -p public/{es,en}
|
||||
# - sphinx-build -b html ./docs/es/source/ public/es
|
||||
# - sphinx-build -b html ./docs/en/source/ public/en
|
||||
# artifacts:
|
||||
# paths:
|
||||
# - public
|
||||
# rules:
|
||||
# - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|
||||
|
|
Loading…
Reference in New Issue