Update .gitlab-ci.yml file
This commit is contained in:
parent
ba497b1ee0
commit
cc1e8a1c6d
|
@ -12,6 +12,94 @@ test:cargo:
|
||||||
- cargo clippy -- -D warnings
|
- cargo clippy -- -D warnings
|
||||||
- cargo test
|
- cargo test
|
||||||
|
|
||||||
|
build:
|
||||||
|
stage: build
|
||||||
|
image: categulario/rust-cli-image:latest
|
||||||
|
script:
|
||||||
|
# build the binary
|
||||||
|
- cargo build --locked --release
|
||||||
|
# create the tar package
|
||||||
|
- mkdir -p build
|
||||||
|
# move things to the build directory
|
||||||
|
- cp target/release/pizarra build/pizarra
|
||||||
|
- cp res/icons/tk.categulario.pizarra.svg build/pizarra.svg
|
||||||
|
- cp res/pizarra.desktop build/pizarra.desktop
|
||||||
|
- cp CHANGELOG.md build/CHANGELOG.md
|
||||||
|
- cp README.md build/README.md
|
||||||
|
- cp LICENSE build/LICENSE
|
||||||
|
# compress the tar file
|
||||||
|
- tar -cvzf pizarra-${CI_COMMIT_TAG:1}-x86_64.tar.gz build/
|
||||||
|
# makes the debian archive
|
||||||
|
- ./debpackage.sh
|
||||||
|
# computes the sums
|
||||||
|
- sha256sum pizarra-${CI_COMMIT_TAG:1}-x86_64.tar.gz > pizarra-${CI_COMMIT_TAG:1}-x86_64.tar.gz.sum
|
||||||
|
- sha256sum debian-package/pizarra_${CI_COMMIT_TAG:1}_amd64.deb > pizarra_${CI_COMMIT_TAG:1}_amd64.deb.sum
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- pizarra-${CI_COMMIT_TAG:1}-x86_64.tar.gz
|
||||||
|
- debian-package/pizarra_${CI_COMMIT_TAG:1}_amd64.deb
|
||||||
|
- pizarra-${CI_COMMIT_TAG:1}-x86_64.tar.gz.sum
|
||||||
|
- pizarra_${CI_COMMIT_TAG:1}_amd64.deb.sum
|
||||||
|
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 pizarra-${CI_COMMIT_TAG:1}-x86_64.tar.gz $SERVER_USER@$SERVER_HOST:$LINUX_RELEASE_PATH
|
||||||
|
- scp pizarra-${CI_COMMIT_TAG:1}-x86_64.tar.gz.sum $SERVER_USER@$SERVER_HOST:$LINUX_RELEASE_PATH
|
||||||
|
- scp debian-package/pizarra_${CI_COMMIT_TAG:1}_amd64.deb $SERVER_USER@$SERVER_HOST:$DEBIAN_RELEASE_PATH
|
||||||
|
- scp pizarra_${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*/
|
||||||
|
|
||||||
|
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:
|
pages:
|
||||||
image: python:3.8-alpine
|
image: python:3.8-alpine
|
||||||
stage: deploy
|
stage: deploy
|
||||||
|
|
Loading…
Reference in New Issue