This repository has been archived by the owner on Jan 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
.gitlab-ci.yml
97 lines (92 loc) · 3.06 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
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
workflow:
rules:
- if: $CI_COMMIT_TAG
when: never
- when: always
stages:
- build
- deploy
build-windows:
stage: build
tags:
- windows
variables:
GIT_STRATEGY: fetch
GIT_CHECKOUT: "true"
GIT_SSH_COMMAND: "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
script:
- '& "C:\\Program Files\\Git\\bin\\bash.exe" --login -c "./tools/package/ci_compile_windows.sh --force"'
artifacts:
paths:
- release-builds
expire_in: 1 week
build-linux:
stage: build
tags:
- docker
image: node:18.5
before_script:
- "which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )"
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
- chmod 700 ~/.ssh/id_rsa
- eval "$(ssh-agent -s)"
- ssh-add ~/.ssh/id_rsa
- ssh-keyscan -t rsa 10.10.10.6 > ~/.ssh/known_hosts
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- chmod 644 ~/.ssh/known_hosts
- git remote set-url origin [email protected]:publicrefinedrd/satisfactoryservermanager.git
- git fetch origin "${CI_COMMIT_SHA}"
- git reset --hard FETCH_HEAD
- "apt-get update -y && apt-get upgrade -y"
script:
- "git submodule update --init"
- npm i -g yarn --force
- npm i -g pkg --force
- npm i -g node-abi --force
- node --version
- "yarn install"
- yarn add node-abi
- "bash tools/package/ci_compile_linux.sh"
artifacts:
paths:
- release-builds
expire_in: 1 week
deploy-docker:
stage: deploy
image: docker:20-dind
tags:
- docker
services:
- name: docker:20-dind
command: ["--tls=false"]
alias: docker
variables:
GIT_STRATEGY: fetch
GIT_CHECKOUT: "true"
GIT_SSH_COMMAND: "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
DOCKERIMG: "mrhid6/ssmagent"
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
script:
- sleep 30
- VERSION=$(cat package.json | grep version | awk '{print $2}' | sed -e 's/"//g' | sed -e 's/,//g')
- echo "${DOCKERPASS}" | docker login -u mrhid6 --password-stdin
- docker build . --tag ${DOCKERIMG}:latest --tag ${DOCKERIMG}:${VERSION}
- docker push ${DOCKERIMG}:latest
- docker push ${DOCKERIMG}:${VERSION}
deploy-release:
stage: deploy
tags:
- windows
variables:
GIT_STRATEGY: fetch
GIT_CHECKOUT: "true"
GIT_SSH_COMMAND: "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
before_script:
- git remote set-url origin [email protected]:publicrefinedrd/satisfactoryservermanager.git
- git fetch origin "${CI_COMMIT_SHA}"
- git reset --hard FETCH_HEAD
script:
- '& "C:\\Program Files\\Git\\bin\\bash.exe" --login -c "bash ./tools/package/ci_deploy_release.sh"'