Skip to content

Commit

Permalink
[BRG-549] Update gitlab ci process
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor committed Apr 21, 2020
1 parent 031d894 commit eb1602f
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 7 deletions.
58 changes: 52 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,66 @@
stages:
- test
- build
- publish

build.publish:
test:lint:
image: node:12
stage: test
cache:
paths:
- node_modules
script:
- npm i
- npm run lint
only:
- merge_requests
tags:
- docker

test:test:
image: node:12
stage: test
cache:
paths:
- node_modules
script:
- npm i
- npm run test
only:
- merge_requests
tags:
- docker

build:
image: node:10.16
stage: build
before_script:
- apt-get update -y && apt-get -y --allow-unauthenticated install curl jq
cache:
paths:
- node_modules
script:
- npm i
- npm run build-ext
- ACCESS_TOKEN=$(curl "https://accounts.google.com/o/oauth2/token" -d "client_id=${CHROME_CLIENT_ID}&client_secret=${CHROME_CLIENT_SECRET}&refresh_token=${CHROME_REFRESH_TOKEN}&grant_type=refresh_token&redirect_uri=urn:ietf:wg:oauth:2.0:oob" | jq -r .access_token)
- 'curl -H "Authorization: Bearer ${ACCESS_TOKEN}" -H "x-goog-api-version: 2" -X PUT -T build/zip/echo_bridge.zip -v "https://www.googleapis.com/upload/chromewebstore/v1.1/items/${CHROME_APP_ID}"'
- 'curl -H "Authorization: Bearer ${ACCESS_TOKEN}" -H "x-goog-api-version: 2" -H "Content-Length: 0" -X POST -v "https://www.googleapis.com/chromewebstore/v1.1/items/${CHROME_APP_ID}/publish?publishTarget=default"'
only:
- tags
except:
- /^.*rc.*$/
artifacts:
paths:
- build/zip/echo_bridge.zip
tags:
- docker

publish:
stage: publish
dependencies:
- build
script:
- ACCESS_TOKEN=$(curl "https://accounts.google.com/o/oauth2/token" -d "client_id=${CHROME_CLIENT_ID}&client_secret=${CHROME_CLIENT_SECRET}&refresh_token=${CHROME_REFRESH_TOKEN}&grant_type=refresh_token&redirect_uri=urn:ietf:wg:oauth:2.0:oob" | jq -r .access_token)
- 'curl -H "Authorization: Bearer ${ACCESS_TOKEN}" -H "x-goog-api-version: 2" -X PUT -T ./build/zip/echo_bridge.zip -v "https://www.googleapis.com/upload/chromewebstore/v1.1/items/${CHROME_APP_ID}"'
- 'curl -H "Authorization: Bearer ${ACCESS_TOKEN}" -H "x-goog-api-version: 2" -H "Content-Length: 0" -X POST -v "https://www.googleapis.com/chromewebstore/v1.1/items/${CHROME_APP_ID}/publish?publishTarget=default"'
tags:
- docker
only:
- tags
except:
- /^.*rc.*$/
2 changes: 1 addition & 1 deletion config/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"96": "images/96.png",
"128": "images/128.png"
},
"version": "1.16.1",
"version": "1.16.2",
"background": {
"scripts": [
"background.js"
Expand Down

0 comments on commit eb1602f

Please sign in to comment.