.gitlab-ci.yml 2.66 KB
Newer Older
1
variables:
chickahoona's avatar
chickahoona committed
2
  CONTAINER_TEST_IMAGE: registry.gitlab.com/psono/psono-client:$CI_BUILD_REF_NAME
3 4 5 6 7 8 9 10 11 12
  CONTAINER_RELEASE_IMAGE: registry.gitlab.com/psono/psono-client:latest

stages:
  - test
  - build
  - release
  - deploy

unittests:
  stage: test
13
  image: ubuntu:16.04
14 15 16
  script:
    - sh ./var/build-ubuntu.sh
    - karma start ./unittests/karma-phantom.conf.js
17 18 19 20 21 22

linter:
  stage: test
  image: ubuntu:16.04
  script:
    - sh ./var/build-ubuntu.sh
23
    - cat ./build/firefox/manifest.json
24
    - addons-linter ./build/firefox
25 26 27 28 29 30


docker-image:
  stage: build
  image: ubuntu:16.04
  services:
chickahoona's avatar
chickahoona committed
31
    - docker:dind
32 33 34
  variables:
    DOCKER_HOST: 'tcp://docker:2375'
  script:
35
    - sh ./var/build-ubuntu.sh
chickahoona's avatar
chickahoona committed
36 37 38 39 40 41
    - set -x && curl -fSL "https://get.docker.com/builds/Linux/x86_64/docker-1.12.0.tgz" -o docker.tgz && echo "3dd07f65ea4a7b4c8829f311ab0213bca9ac551b5b24706f3e79a97e22097f8b *docker.tgz" | sha256sum -c - && tar -xzvf docker.tgz && mv docker/* /usr/local/bin/
    - docker info
    - gulp
    - docker login -u gitlab-ci-token -p "$CI_BUILD_TOKEN" registry.gitlab.com
    - docker build -t $CONTAINER_TEST_IMAGE .
    - docker push $CONTAINER_TEST_IMAGE
42 43 44 45

firefox-extension:
  stage: build
  script:
chickahoona's avatar
chickahoona committed
46
    - sh ./var/build-ubuntu.sh
47 48 49
  artifacts:
    name: "firefox_$CI_BUILD_REF_NAME"
    paths:
50
    - build/firefox/
51 52 53 54

chrome-extension:
  stage: build
  script:
chickahoona's avatar
chickahoona committed
55
    - sh ./var/build-ubuntu.sh
56 57 58 59 60 61 62 63 64
  artifacts:
    name: "chrome_$CI_BUILD_REF_NAME"
    paths:
    - build/chrome/

job-release-docker:
  stage: release
  image: docker:git
  services:
chickahoona's avatar
chickahoona committed
65
    - docker:dind
66
  script:
chickahoona's avatar
chickahoona committed
67 68 69 70 71
    - docker info
    - docker login -u gitlab-ci-token -p "$CI_BUILD_TOKEN" registry.gitlab.com
    - docker pull $CONTAINER_TEST_IMAGE
    - docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
    - docker push $CONTAINER_RELEASE_IMAGE
72
  only:
73
    - /^v[0-9]*\.[0-9]*\.[0-9]*$/
74 75 76

job-deploy:
  stage: deploy
77 78
  image: docker:git
  services:
chickahoona's avatar
chickahoona committed
79
    - docker:dind
80
  script:
81
    - sh ./var/deploy.sh
chickahoona's avatar
chickahoona committed
82 83 84
  environment:
    name: production
    url: https://psono.pw
85
  only:
86
    - /^v[0-9]*\.[0-9]*\.[0-9]*$/
87 88 89 90 91 92 93

job-deploy-chrome:
  stage: deploy
  image: ubuntu:16.04
  script:
    - sh ./var/build-ubuntu.sh
    - sh ./var/deploy-chrome-extension.sh
chickahoona's avatar
chickahoona committed
94 95 96
  environment:
    name: chrome-webstore
    url: https://chrome.google.com/webstore/detail/psonopw/eljmjmgjkbmpmfljlmklcfineebidmlo
97
  when: manual
98
  only:
99
    - /^v[0-9]*\.[0-9]*\.[0-9]*$/
100 101 102 103 104 105 106 107 108 109 110 111 112

job-deploy-firefox:
  stage: deploy
  image: ubuntu:16.04
  script:
    - sh ./var/build-ubuntu.sh
    - sh ./var/deploy-firefox-extension.sh
  environment:
    name: firefox-webstore
    url: https://addons.mozilla.org/de/firefox/addon/psono-pw-password-manager/
  when: manual
  only:
    - /^v[0-9]*\.[0-9]*\.[0-9]*$/