Rename stages and jobs to be more sane

This commit is contained in:
Daniel_I_Am 2020-10-28 20:29:41 +01:00
parent 6e63393b3d
commit 437ec8d117
No known key found for this signature in database
GPG Key ID: 80C428FCC9743E84

View File

@ -10,12 +10,12 @@ variables:
NODE_MODULES_DIRECTORY: 'wwwroot/node_modules'
stages:
- version
- build
- test
- release
- docker
- deploy
- "Build Code"
- "Test Code"
- "Compile Release"
- "Get Next Version"
- "Build Docker Image"
- "Pull Image on Production"
cache:
key: "$CI_JOB_STAGE-$CI_COMMIT_REF_SLUG"
@ -34,16 +34,96 @@ cache:
#
policy: pull-push
version:
stage: version
"Build dotnet":
stage: "Build Code"
only:
changes:
- ChaosBot/**/*
tags:
- docker
- hawkeye
script:
- 'dotnet restore --packages $NUGET_PACKAGES_DIRECTORY'
- 'dotnet build --no-restore'
"Test dotnet":
stage: "Test Code"
only:
changes:
- ChaosBot/**/*
refs:
- master
dependencies:
- "Build dotnet"
tags:
- docker
- hawkeye
script:
- 'dotnet restore --packages $NUGET_PACKAGES_DIRECTORY'
- 'dotnet test --no-restore'
"Build node":
image: node:latest
stage: "Build Code"
only:
changes:
- ChaosBot/wwwroot/*
tags:
- docker
- hawkeye
script:
- 'cd ChaosBot/wwwroot'
- 'yarn install'
- 'yarn build'
artifacts:
paths:
- ChaosBot/wwwroot/dist/*
"Test node":
image: node:latest
stage: "Test Code"
only:
changes:
- ChaosBot/wwwroot/*
dependencies:
- "Build node"
tags:
- docker
- hawkeye
script:
- 'cd ChaosBot/wwwroot'
- 'yarn install'
- 'yarn lint'
"Compile release":
stage: "Compile Release"
only:
changes:
- ChaosBot/**/*
dependencies:
- "Test dotnet"
- "Build node"
- "Test node"
tags:
- docker
- hawkeye
script:
- 'dotnet restore --packages $NUGET_PACKAGES_DIRECTORY'
- 'dotnet publish -c Release --runtime linux-musl-x64 -o build -p:PublishSingleFile=true ChaosBot'
artifacts:
paths:
- build/*
"Get next version":
stage: "Get Next Version"
only:
changes:
- ChaosBot/**/*
refs:
- master
tags:
- docker
- hawkeye
- docker
- hawkeye
script:
- 'apk add git grep npm openssh-client'
- 'npm install -g semver'
@ -59,101 +139,9 @@ version:
paths:
- version
build_dotnet:
stage: build
only:
changes:
- ChaosBot/**/*
refs:
- master
dependencies:
- version
tags:
- docker
- hawkeye
script:
- 'dotnet restore --packages $NUGET_PACKAGES_DIRECTORY'
- 'dotnet build --no-restore'
tests_dotnet:
stage: test
only:
changes:
- ChaosBot/**/*
refs:
- master
dependencies:
- build_dotnet
tags:
- docker
- hawkeye
script:
- 'dotnet restore --packages $NUGET_PACKAGES_DIRECTORY'
- 'dotnet test --no-restore'
build_node:
image: node:latest
stage: build
only:
changes:
- ChaosBot/**/*
refs:
- master
dependencies:
- version
tags:
- docker
- hawkeye
script:
- 'cd ChaosBot/wwwroot'
- 'yarn install'
- 'yarn build'
artifacts:
paths:
- ChaosBot/wwwroot/dist/*
tests_node:
image: node:latest
stage: test
only:
changes:
- ChaosBot/**/*
refs:
- master
dependencies:
- build_node
tags:
- docker
- hawkeye
script:
- 'cd ChaosBot/wwwroot'
- 'yarn install'
- 'yarn lint'
release:
stage: release
only:
changes:
- ChaosBot/**/*
refs:
- master
dependencies:
- tests_dotnet
- tests_node
- build_node
tags:
- docker
- hawkeye
script:
- 'dotnet restore --packages $NUGET_PACKAGES_DIRECTORY'
- 'dotnet publish -c Release --runtime linux-musl-x64 -o build -p:PublishSingleFile=true ChaosBot'
artifacts:
paths:
- build/*
docker:
"Build docker image":
image: docker:stable
stage: docker
stage: "Build Docker Image"
only:
changes:
- ChaosBot/**/*
@ -163,8 +151,8 @@ docker:
- docker
- hawkeye
dependencies:
- version
- release
- "Get next version"
- "Compile release"
script:
# Log in to the registry
- 'docker login -u=$REGISTRY_USER -p=$REGISTRY_PASS registry.chaoticlogic.us'
@ -178,8 +166,8 @@ docker:
- 'docker -H unix:///var/run/docker.sock image push registry.chaoticlogic.us/chaosbot:latest'
deploy:
stage: deploy
"Pull image on production":
stage: "Pull Image on Production"
only:
changes:
- ChaosBot/**/*
@ -189,7 +177,7 @@ deploy:
- docker
- hawkeye
dependencies:
- docker
- "Build docker image"
script:
- 'apk add curl jq'
# Sign in with credentials