shad-go/.releaser-ci.yml

81 lines
2.7 KiB
YAML

check:
image: gitlab.manytask.org:5050/go/public-2024-spring/build
script:
- golangci-lint run --build-tags private,solution ./...
#- go test -v -tags private,solution ./...
#- go test -v -race -tags private,solution ./...
- sudo -u nobody HOME=/tmp PATH=$PATH git config --global --add safe.directory /builds/slon/shad-go-private
- sudo -u nobody HOME=/tmp PATH=$PATH /usr/local/go/bin/go test -tags private,solution ./...
- sudo -u nobody HOME=/tmp PATH=$PATH /usr/local/go/bin/go test -tags private,solution -race ./...
rebuild-base-image:
tags:
- docker
when: manual
script:
- docker build -f build.docker -t gitlab.manytask.org:5050/go/public-2024-spring/build .
- docker push gitlab.manytask.org:5050/go/public-2024-spring/build:latest
deploy:
only:
- master
tags:
- docker
script:
- docker pull gitlab.manytask.org:5050/go/public-2024-spring/build:latest
- docker build -f testenv.docker -t gitlab.manytask.org:5050/go/public-2024-spring .
- docker push gitlab.manytask.org:5050/go/public-2024-spring:latest
build-slides:
only:
- master
tags:
- docker
script:
- docker build lectures -t gitlab.manytask.org:5050/go/public-2024-spring/lectures
- docker push gitlab.manytask.org:5050/go/public-2024-spring/lectures
update-config:
only:
- master
script:
- >
curl -v --fail --silent -X POST \
-H "Authorization: Bearer $TESTER_TOKEN" \
-H "Content-type: application/x-yaml" \
--data-binary "@.manytask.yml" \
https://go.manytask.org/api/update_config
- >
curl -v --fail --silent -X POST \
-H "Authorization: Bearer $TESTER_TOKEN" \
https://go.manytask.org/api/update_cache
push-to-public:
stage: .post
image: gitlab.manytask.org:5050/go/public-2024-spring
parallel:
matrix:
- REMOTE:
- git@github.com:slon/shad-go.git
- git@gitlab.manytask.org:go/public-2024-spring.git
only:
- master
script:
- testtool list-private-files > /tmp/private_files.txt
- git filter-repo --force --paths-from-file /tmp/private_files.txt --invert-path
- echo $GITHUB_PUSH_KEY | base64 -d > private.key && chmod go-rwx private.key
- git branch -D main || true
- git checkout -b main
- git remote rm github || true
- env GIT_SSH_COMMAND="ssh -i ${PWD}/private.key -o StrictHostKeyChecking=no" git remote add -f github $REMOTE
- env GIT_SSH_COMMAND="ssh -i ${PWD}/private.key -o StrictHostKeyChecking=no" git push github main
deploy-slides:
stage: .post
only:
- master
tags:
- web
script:
- docker pull gitlab.manytask.org:5050/go/public-2024-spring/lectures
- cd /srv/manytask/go && docker compose up -d