52 lines
1.7 KiB
YAML
52 lines
1.7 KiB
YAML
# All pipeline steps run in their own container, but the working directory (with code) is in a shared
|
|
# volume, which is mounted in all the containers. So modifying the filesystem (within the working dir)
|
|
# is persistent between build steps.
|
|
|
|
pipeline:
|
|
lint:
|
|
image: offline-twitter/go
|
|
commands:
|
|
- golangci-lint run
|
|
|
|
test:
|
|
image: offline-twitter/go
|
|
commands:
|
|
- mkdir persistence/test_profiles
|
|
- go test -bench=. -cover ./...
|
|
|
|
integration_test:
|
|
image: offline-twitter/go
|
|
commands:
|
|
- cd cmd
|
|
- ./tests.sh
|
|
|
|
version_bump_test:
|
|
image: offline-twitter/go
|
|
when:
|
|
branch: release-*
|
|
commands:
|
|
- export version=$(echo $CI_COMMIT_BRANCH | grep -Poh "(?<=^release-)\d+\.\d+\.\d+")
|
|
- curl https://apt.playfulpachyderm.com/KEY.gpg | sudo apt-key add -
|
|
- echo "deb https://apt.playfulpachyderm.com/ ./" | sudo tee /etc/apt/sources.list.d/offline_twitter.list
|
|
- sudo apt update
|
|
- sudo apt install -y offline-twitter-engine
|
|
- which twitter
|
|
- twitter create_profile outdated_profile
|
|
- cd outdated_profile
|
|
- twitter fetch_user michaelmalice
|
|
- twitter get_user_tweets michaelmalice
|
|
- (cd ../cmd && ./compile.sh $version)
|
|
- which ../cmd/tw
|
|
- ../cmd/tw fetch_user michaelmalice
|
|
|
|
dpkg_build_and_upload:
|
|
when:
|
|
branch: release-*
|
|
image: offline-twitter/deploy
|
|
commands:
|
|
- export version=$(echo $CI_COMMIT_BRANCH | grep -Poh "(?<=^release-)\d+\.\d+\.\d+")
|
|
- cd build
|
|
- ./build_dpkg.sh $version
|
|
- scp offline-twitter-engine_$${version}_all.deb aptrepo@apt.playfulpachyderm.com:/apt-repo/test-repo
|
|
- ssh aptrepo@apt.playfulpachyderm.com "cd ~/test-repo && ./update.sh"
|