2018-02-12 15:37:33 +00:00
|
|
|
version: 2
|
|
|
|
|
2018-08-05 14:28:05 +00:00
|
|
|
defaults: &defaults
|
|
|
|
docker:
|
2018-11-25 00:03:50 +00:00
|
|
|
- image: gallileo/radarr-cci-primary:5.8.8
|
2018-08-05 14:28:05 +00:00
|
|
|
environment:
|
|
|
|
BUILD_VERSION: 0.2.0
|
|
|
|
|
2018-02-12 15:37:33 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
2018-08-05 14:28:05 +00:00
|
|
|
<<: *defaults
|
2018-02-12 15:37:33 +00:00
|
|
|
steps:
|
2018-08-05 14:28:05 +00:00
|
|
|
- restore_cache:
|
|
|
|
keys:
|
|
|
|
- source-v1-{{ .Branch }}-{{ .Revision }}
|
|
|
|
- source-v1-{{ .Branch }}-
|
|
|
|
- source-v1-
|
2018-02-12 15:37:33 +00:00
|
|
|
- checkout
|
|
|
|
- run: git submodule update --init --recursive
|
2018-08-05 14:28:05 +00:00
|
|
|
- save_cache:
|
|
|
|
key: source-v1-{{ .Branch }}-{{ .Revision }}
|
|
|
|
paths:
|
|
|
|
- ".git"
|
|
|
|
- run:
|
|
|
|
name: Patching Assembly Info
|
|
|
|
command: sed -i "s/AssemblyVersion(\".*\")/AssemblyVersion(\"$BUILD_VERSION.$CIRCLE_BUILD_NUM\")/gi" src/NzbDrone.Common/Properties/SharedAssemblyInfo.cs && cat src/NzbDrone.Common/Properties/SharedAssemblyInfo.cs
|
2018-02-12 16:31:18 +00:00
|
|
|
- run:
|
2018-02-12 16:37:11 +00:00
|
|
|
name: Clean Build
|
|
|
|
command: ./build.sh Clean
|
|
|
|
- run:
|
|
|
|
name: Restore Nuget
|
|
|
|
command: ./build.sh NugetMono
|
2018-02-12 15:37:33 +00:00
|
|
|
- run:
|
|
|
|
name: Build
|
2018-02-12 16:31:18 +00:00
|
|
|
command: ./build.sh Build
|
2018-08-05 14:28:05 +00:00
|
|
|
- restore_cache:
|
|
|
|
keys:
|
|
|
|
- v1-npm-deps-{{ checksum "package.json" }}
|
|
|
|
# Find the most recent cache used from any branch
|
|
|
|
- v1-npm-deps-
|
2018-02-12 16:31:18 +00:00
|
|
|
- run:
|
|
|
|
name: Gulp
|
|
|
|
command: ./build.sh Gulp
|
2018-08-05 14:28:05 +00:00
|
|
|
- save_cache:
|
|
|
|
key: v1-npm-deps-{{ checksum "package.json" }}
|
|
|
|
paths:
|
|
|
|
- "node_modules"
|
2018-02-12 16:31:18 +00:00
|
|
|
- run:
|
|
|
|
name: Package
|
|
|
|
command: ./build.sh Package
|
|
|
|
- run:
|
2018-02-12 16:33:14 +00:00
|
|
|
name: Preparing Tests
|
2018-08-05 14:28:05 +00:00
|
|
|
command: mkdir -p _tests/reports/junit && mkdir -p ../.config/Radarr && chmod -R 777 ../.config
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: .
|
|
|
|
# Must be relative path from root
|
|
|
|
paths:
|
|
|
|
- _output
|
|
|
|
- _output_mono
|
|
|
|
- _output_osx
|
|
|
|
- _output_osx_app
|
|
|
|
- _tests
|
|
|
|
- setup
|
|
|
|
- .circleci
|
2018-11-24 18:47:37 +00:00
|
|
|
- deploy.sh
|
2018-08-05 14:28:05 +00:00
|
|
|
unit_tests:
|
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
2018-02-12 15:37:33 +00:00
|
|
|
- run:
|
2018-08-05 14:28:05 +00:00
|
|
|
name: Preparing Tests
|
|
|
|
command: mkdir -p ../.config/Radarr && chmod -R 777 ../.config
|
|
|
|
- run:
|
|
|
|
name: Unit Tests
|
|
|
|
command: ./_tests/test.sh Linux Unit
|
2018-02-12 16:10:44 +00:00
|
|
|
- store_test_results:
|
|
|
|
path: _tests/reports/
|
2018-08-05 14:28:05 +00:00
|
|
|
|
|
|
|
integration_tests:
|
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
|
|
|
- run:
|
|
|
|
name: Copy Binaries for Integration Tests
|
|
|
|
command: cp -R _output_mono/ _tests/bin
|
|
|
|
- run:
|
|
|
|
name: Preparing Tests
|
|
|
|
command: mkdir -p ../.config/Radarr && chmod -R 777 ../.config
|
|
|
|
- run:
|
|
|
|
name: Integration Tests
|
|
|
|
command: ./_tests/test.sh Linux Integration
|
|
|
|
- store_test_results:
|
|
|
|
path: _tests/reports/
|
|
|
|
publish_artifacts:
|
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
|
|
|
- run:
|
|
|
|
name: "Creating packages"
|
|
|
|
command: |
|
|
|
|
mkdir -p _packages/
|
|
|
|
cp -r _output/ _packages/Radarr
|
|
|
|
zip -r _packages/Radarr.${CIRCLE_BRANCH//\//-}.$BUILD_VERSION.$CIRCLE_BUILD_NUM.windows.zip _packages/Radarr
|
|
|
|
rm -rf _packages/Radarr
|
|
|
|
cp -r _output_mono/ _packages/Radarr
|
2018-11-24 15:31:53 +00:00
|
|
|
tar -zcvf _packages/Radarr.${CIRCLE_BRANCH//\//-}.$BUILD_VERSION.$CIRCLE_BUILD_NUM.linux.tar.gz -C _packages Radarr
|
2018-08-05 14:28:05 +00:00
|
|
|
rm -rf _packages/Radarr
|
|
|
|
cp -r _output_osx/ _packages/Radarr
|
2018-11-24 15:31:53 +00:00
|
|
|
tar -zcvf _packages/Radarr.${CIRCLE_BRANCH//\//-}.$BUILD_VERSION.$CIRCLE_BUILD_NUM.osx.tar.gz -C _packages Radarr
|
2018-08-05 14:28:05 +00:00
|
|
|
rm -rf _packages/Radarr
|
|
|
|
cd _output_osx_app/
|
|
|
|
zip -r ../_packages/Radarr.${CIRCLE_BRANCH//\//-}.$BUILD_VERSION.$CIRCLE_BUILD_NUM.osx-app.zip *
|
|
|
|
- run:
|
|
|
|
name: "Creating Installer"
|
|
|
|
command: wine setup/inno/ISCC.exe setup/nzbdrone.iss && cp -r setup/Output/Radarr* _packages/
|
2018-02-12 16:31:18 +00:00
|
|
|
- store_artifacts:
|
2018-08-05 14:28:05 +00:00
|
|
|
path: _packages
|
|
|
|
destination: artifacts
|
2019-02-18 10:07:51 +00:00
|
|
|
#- run:
|
|
|
|
# name: "Deploying"
|
|
|
|
# command: chmod +x deploy.sh && ./deploy.sh
|
2018-08-05 14:28:05 +00:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: .
|
|
|
|
# Must be relative path from root
|
|
|
|
paths:
|
|
|
|
- _packages
|
|
|
|
deploy:
|
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
|
|
|
- source-v1-{{ .Branch }}-{{ .Revision }}
|
|
|
|
- source-v1-{{ .Branch }}-
|
|
|
|
- source-v1-
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Creating Release
|
|
|
|
command: export LC_ALL=C.UTF-8 && export changelog=$(GITCHANGELOG_CONFIG_FILENAME=.gitchangelog.rc.release gitchangelog) && echo "Deploying v$BUILD_VERSION.$CIRCLE_BUILD_NUM to Github, with changelog:\n\n$changelog" && github-release release -u Radarr -r Radarr -t "v$BUILD_VERSION" -p --draft -d "$changelog" -n "Pre-Release v$BUILD_VERSION"
|
|
|
|
- run:
|
|
|
|
name: Uploading Assets
|
|
|
|
command: cd _packages && ls Radarr.*.* | xargs -n1 -P0 -I{} -- github-release upload -u Radarr -r Radarr -t "v$BUILD_VERSION.$CIRCLE_BUILD_NUM" --name {} --file {}
|
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
|
|
|
|
build_and_test:
|
|
|
|
jobs:
|
|
|
|
- build
|
|
|
|
- unit_tests:
|
|
|
|
requires:
|
|
|
|
- build
|
2018-10-30 10:04:07 +00:00
|
|
|
#- integration_tests:
|
|
|
|
# requires:
|
|
|
|
# - build
|
2018-08-05 14:28:05 +00:00
|
|
|
- publish_artifacts:
|
|
|
|
requires:
|
|
|
|
- build
|
2018-10-30 10:04:07 +00:00
|
|
|
#- request_deploy:
|
|
|
|
# type: approval
|
|
|
|
# requires:
|
|
|
|
# - publish_artifacts
|
|
|
|
#- deploy:
|
|
|
|
# requires:
|
|
|
|
# - request_deploy
|