-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
34 lines (33 loc) · 1.37 KB
/
.gitlab-ci.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
stages:
- deploy
deploy_packages:
stage: deploy
image: yobasystems/alpine-docker
before_script:
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -H "${DEPLOYMENT_STAGING_HOST}" >> ~/.ssh/known_hosts
script:
- git checkout $CI_COMMIT_REF_NAME
- git reset --hard origin/$CI_COMMIT_REF_NAME
- APP_NAME=$([[ $CI_COMMIT_REF_NAME == "develop" ]] && echo "" || echo "-$(echo $CI_COMMIT_REF_NAME | cut -d "-" -f 2)")
- API_URL=$(echo "$STAGING_BASE_URL" | sed "s/APP/$APP_NAME/g")
- sed -e "s+https://your-backend-url+$API_URL+g;s+/your-api-namespace+$STAGING_API_URL+g;s+https://public@sentry.example.com/1+$STAGING_SENRTY_DSN+g;s+release+$STAGING_SENTRY_RELEASE+g" .env.example > .env
- >
docker run --rm -t
--env ELECTRON_CACHE="/root/.cache/electron"
--env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder"
-v ${PWD}:/project
-v ${PWD##*/}-node-modules:/project/node_modules
-v ~/.cache/electron:/root/.cache/electron
-v ~/.cache/electron-builder:/root/.cache/electron-builder
electronuserland/builder:wine
/bin/bash -c "npm install && npm run package-win && npm run package-linux"
- chmod -R 666 ./release/*
- rsync -a --delete ./release/IA* $DEPLOY_PATH
only:
refs:
- develop
- demo
- /^demo-.*$/