forked from opensourcepos/opensourcepos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
68 lines (64 loc) · 2.92 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
sudo: required
branches:
except:
- weblate
services:
- docker
before_install:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
- docker --version
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker run --rm -v $(pwd):/app jekkos/composer composer install
- docker run --rm -v $(pwd):/app jekkos/composer php bin/install.php translations develop
- sed -i "s/'\(dev\)'/'$rev'/g" application/config/config.php
- version=$(grep application_version application/config/config.php | sed "s/.*=\s'\(.*\)';/\1/g")
- echo "$version-$branch-$rev"
- npm version "$version-$branch-$rev" --force || true
- docker run --rm -it -v $(pwd):/app -w /app opensourcepos/node-grunt-bower
sh -c "npm install && bower install && grunt package"
- docker build . --target ospos -t ospos
- docker-compose -f docker-compose.test.yml up --abort-on-container-exit
- docker build database/ -t jekkos/opensourcepos:sqlscript
env:
global:
- DOCKER_COMPOSE_VERSION=1.29.1
- BRANCH=$(echo ${TRAVIS_BRANCH} | sed s/feature\\///)
- date=`date +%Y%m%d%H%M%S` && branch=${TRAVIS_BRANCH} && rev=`git rev-parse --short=6 HEAD`
after_success:
- TAG=${TRAVIS_TAG:-$BRANCH}
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" && docker tag "ospos:latest"
"jekkos/opensourcepos:$TAG" && docker push "jekkos/opensourcepos:$TAG" && docker push "jekkos/opensourcepos:sqlscript"
- sudo mv dist/opensourcepos.tgz "dist/opensourcepos.$version.$rev.tgz"
- sudo mv dist/opensourcepos.zip "dist/opensourcepos.$version.$rev.zip"
before_deploy:
- npm set //npm.pkg.github.com/:_authToken "$NPM_TOKEN"
deploy:
- provider: npm
file: dist/opensourcepos.$version.$rev.tgz
registry: npm.pkg.github.com
email: [email protected]
skip_cleanup: true
api_key:
secure: "bmOfMoGBi+wTEdTbIB7wPenNTCZrmHAa05xZnMxZSOjxplZpnZSO4Tvnnkihz9LpbF3xT1hm76AJJuZonu2HKtUez+6L4Fg+i/jS8Ij/BZlbvKBVTeB+2yN09ncXNmObnl1bShtm90d2WYQJKk3NJGuEboFQNxwJLYJXg33iMhc="
on:
all_branches: true
- provider: releases
file: dist/opensourcepos.$version.$rev.zip
name: "OpensourcePos $version"
release_notes_file: WHATS_NEW.txt
prerelease: true
skip_cleanup: true
user: jekkos
overwrite: true
api_key:
secure: Ax25mMRDfHVf/HjRwqxYJe2oMnWC4sc2aKIiUxAOviVJJSCl4GMWhcFlUNnFsDcKIg2ofEGMVD6b9cTBuOwPDvymUDFnLNCCgDWve+vRDdWaTkTipn77Qk4c9UO9VvuzlPSKopChefPHlQ0n1rEmAMiKIXuqjUlNGqybW4FLP4E=
on:
tags: true
branch: master