Skip to content

Instantly share code, notes, and snippets.

@TrLucas
Created May 18, 2018 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TrLucas/953c1020d5124070d43245fea148eb4d to your computer and use it in GitHub Desktop.
Save TrLucas/953c1020d5124070d43245fea148eb4d to your computer and use it in GitHub Desktop.
stages:
- install
- test
- build
- deploy
prepare-dependencies:
stage: install
script:
# Fix for ensure_dependencies.py; failed on multirunner while trying to manually exlucde files
- mkdir -p .git/info && touch .git/info/exclude
- sudo apt-get update -qq && sudo apt-get install -y -qq python-pip
- which npm || (curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash ; sudo apt-get install -y nodejs)
- sudo pip install -r build_requirements.txt
- python ensure_dependencies.py
cache:
key: cache_$CI_COMMIT_SHA
paths:
- ./
policy: push
npmtests:
stage: test
script:
# in case caching fails
- python ensure_dependencies.py
- ./runtests
cache:
key: cache_$CI_COMMIT_SHA
paths:
- ./
policy: pull
# reusable template for build jobs
.build_template: &create_build
stage: build
script:
- python build.py build -t $TARGET
artifacts:
expire_in: 3 days
paths:
- ./*.xpi
- ./*.zip
- ./*.appx
cache:
key: cache_$CI_COMMIT_SHA
paths:
- ./
policy: pull
# reusable template for deploy jobs
.deploy_template: &deploy_build
stage: deploy
script:
- python build.py upload -t $TARGET
cache:
key: cache_$CI_COMMIT_SHA
paths:
- ./
policy: pull
environment:
name: devbuilds
# actual build jobs
build-nightly:gecko:
variables:
TARGET: gecko
<<: *create_build
only:
- master
build-nightly:chrome:
variables:
TARGET: chrome
<<: *create_build
only:
- master
build-nightly:edge:
variables:
TARGET: edge
<<: *create_build
only:
- edge
# actual deploy jobs
deploy-nightly:gecko:
variables:
TARGET: gecko
<<: *deploy_build
dependencies:
- build-nightly:gecko
only:
- master
deploy-nightly:chrome:
variables:
TARGET: chrome
<<: *deploy_build
dependencies:
- build-nightly:chrome
only:
- master
deploy-nightly:edge:
variables:
TARGET: edge
<<: *deploy_build
dependencies:
- build-nightly:edge
only:
- edge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment