merge-requests/31/head v1.20.1111testing
Paul Traina 2020-11-11 22:40:44 -08:00
rodzic aa8aa71240
commit 5a18316401
1 zmienionych plików z 43 dodań i 21 usunięć

Wyświetl plik

@ -6,7 +6,16 @@ variables:
APT_CACHE_DIR: $CI_PROJECT_DIR/.cache/apt APT_CACHE_DIR: $CI_PROJECT_DIR/.cache/apt
NPM_CONFIG_CACHE: $CI_PROJECT_DIR/.cache/npm NPM_CONFIG_CACHE: $CI_PROJECT_DIR/.cache/npm
GCLOUD_SERVICE_ACCOUNT: /dev/null GCLOUD_SERVICE_ACCOUNT: /dev/null
GCLOUD_DEPLOY_PATH: gs://download.gridtracker.org/staging/$CI_COMMIT_TAG GCLOUD_RELEASE_DEPLOY_PATH: gs://download.gridtracker.org/release/$CI_COMMIT_TAG
GCLOUD_TESTING_DEPLOY_PATH: gs://download.gridtracker.org/testing/$CI_COMMIT_TAG
# nothing in this file should be allowed to run automatically except for:
# 1. merge requests
# 2. manual tagging
# 3. committing to the default branch
include:
- template: "Workflows/MergeRequest-Pipelines.gitlab-ci.yml"
stages: stages:
- build - build
@ -14,16 +23,12 @@ stages:
- package - package
- deploy - deploy
# only run for merge requests and tags
include:
- template: "Workflows/MergeRequest-Pipelines.gitlab-ci.yml"
default: default:
image: ${DEFAULT_IMAGE} image: ${DEFAULT_IMAGE}
interruptible: true interruptible: true
# just do a quick syntax check job, we don't need to "build" anything here other than the
# just do a quick syntax check job, we don't need to "build" anything here # outer dev environment for gridtracker
npm_test: npm_test:
stage: test stage: test
image: node:latest image: node:latest
@ -38,12 +43,12 @@ npm_test:
# - echo "For example run a lint test" # - echo "For example run a lint test"
# if we've been tagged with a tag starting with v or test_, package binaries and create # package binaries and create build artifacts that may be used in later stages
# build artifacts
packaging: packaging:
stage: package stage: package
rules: rules:
# only do this with a manual tag starting with v or test_
- if: '$CI_COMMIT_TAG =~ /^(v|test_).*/' - if: '$CI_COMMIT_TAG =~ /^(v|test_).*/'
artifacts: artifacts:
paths: paths:
@ -71,17 +76,29 @@ packaging:
- dpkg-buildpackage -uc -us - dpkg-buildpackage -uc -us
- mv ../*.{deb,dsc,buildinfo,tar.xz,changes} build/debian/ - mv ../*.{deb,dsc,buildinfo,tar.xz,changes} build/debian/
# copy the assets over to our distribution storage # copy the assets over to our distribution storage (testing, tag = test_.*)
staging_upload: upload_testing:
stage: deploy stage: deploy
image: google/cloud-sdk:alpine image: google/cloud-sdk:alpine
needs:
- job: packaging
rules: rules:
- if: '$CI_COMMIT_TAG =~ /^(v|test_).*/' - if: '$CI_COMMIT_TAG =~ /^(test_).*/'
script: script:
- echo "This will be the upload script for $CI_COMMIT_TAG"
- echo copying to $GCLOUD_DEPLOY_PATH
- gcloud auth activate-service-account --key-file $GCLOUD_SERVICE_ACCOUNT - gcloud auth activate-service-account --key-file $GCLOUD_SERVICE_ACCOUNT
- cd build; gsutil -m rsync -r . $GCLOUD_DEPLOY_PATH - cd build; gsutil -m rsync -r . $GCLOUD_TESTING_DEPLOY_PATH
# copy the assets over to our distribution storage (full release, tag = v.*)
upload_release:
stage: deploy
image: google/cloud-sdk:alpine
needs:
- job: packaging
rules:
- if: '$CI_COMMIT_TAG =~ /^(v).*/'
script:
- gcloud auth activate-service-account --key-file $GCLOUD_SERVICE_ACCOUNT
- cd build; gsutil -m rsync -r . $GCLOUD_RELEASE_DEPLOY_PATH
# this only creates a "source code release" -- gitlab doesn't specify binaries # this only creates a "source code release" -- gitlab doesn't specify binaries
# except as links to external storage, which is suboptimal for now # except as links to external storage, which is suboptimal for now
@ -89,11 +106,16 @@ source_release:
stage: deploy stage: deploy
image: registry.gitlab.com/gitlab-org/release-cli:latest image: registry.gitlab.com/gitlab-org/release-cli:latest
rules: rules:
- if: '$CI_COMMIT_TAG =~ /^v.*/' - if: '$CI_COMMIT_TAG =~ /^(v).*/'
release:
tag_name: '$CI_COMMIT_TAG'
name: 'GridTracker $CI_COMMIT_TAG'
description: 'GridTracker source archive for $CI_COMMIT_TAG'
ref: '$CI_COMMIT_SHA'
script: script:
- echo 'Release for $CI_COMMIT_TAG' - echo 'Release for $CI_COMMIT_TAG'
release: # (unused yet, need to decide if we do this manually or not)
name: 'GridTracker $CI_COMMIT_TAG' # release-cli create --name "$GridTracker $CI_COMMIT_TAG" \
description: 'GridTracker source $CI_COMMIT_TAG' # --tag-name "$CI_COMMIT_TAG" \
tag_name: '$CI_COMMIT_TAG' # --assets-link "{\"name\":\"${DARWIN_AMD64_BINARY}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${DARWIN_AMD64_BINARY}\"}" \
ref: '$CI_COMMIT_SHA' # --assets-link "{\"name\":\"${LINUX_AMD64_BINARY}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${LINUX_AMD64_BINARY}\"}"