summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 9e5b4759d2df23662c019516f40fd064b499d9de (plain) (blame)
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
98
99
100
101
102
stages:
  - test
  - build
  - deploy

# --- globals -----------------------------------------------------------------

variables:
  CROSS: i686-w64-mingw32.shared
  MP_REPOSITORY: https://gitlab.com/jak89_1/manaplus.git

.job-deploy: &job-deploy
  artifacts:
    paths:
    - build
    - logs
    - public
    when: always
    expire_in: 3 week

.job-build: &job-build
  artifacts:
    paths:
    - build
    - logs
    when: always
    expire_in: 3 week

.job-test: &job-test
  artifacts:
    paths:
    - logs
    when: always
    expire_in: 3 week

# --- jobs --------------------------------------------------------------------

mxe_gcc5:
  image: $CI_REGISTRY_IMAGE:v1.0.4
  stage: build
  except:
    - /^test.*/
    - /^registry.*/
  script:
    - cd /
    - mkdir -p "${CI_PROJECT_DIR}/logs/" || true
    - mkdir -p "${CI_PROJECT_DIR}/build/" || true
    - git clone $CI_REPOSITORY_URL -b $CI_COMMIT_BRANCH /opt || exit 1
    - rm -rf /opt/.git/
    - mv -f opt/* /
    - git clone $MP_REPOSITORY -b master || exit 1
    - chmod +x ./manaplus.sh && ./manaplus.sh
  <<: *job-build
  tags:
    - docker

pages:
  image: debian:stable
  stage: deploy
  only:
    - stable
    - release
  before_script:
    - apt-get update
    - apt-get -y -qq install openssh-client libxml2-utils jsonlint
    - eval $(ssh-agent -s)
    - mkdir -p ~/.ssh
    - echo "${SSH_PRIVATE_KEY_BASE64}" | base64 -d | tr -d '\r' > ~/.ssh/id_rsa
    - chmod -R 700 ~/.ssh
  script:
    - echo "[WIP] mirror"
    - ./pages.sh
    - rm -rf ~/.ssh
  <<: *job-deploy

# note: i guess mxe dl build and patch takes to long, ci allows 'only' 3hours, 
#   there runners are still overwhelmed from building simple stuff
#   may using own runner could make it work a bit faster
registry_deploy:
  image: alpine
  stage: deploy
  only:
    - /^registry_.*/
    - /^registry/.*/
  script:
    - echo "[WIP]"
    - exit 1
  <<: *job-test
  allow_failure: true

test_only:
  image: alpine
  stage: test
  only:
    - /^test_.*/
    - /^test/.*/
  script:
    - echo "ci testing should use branches named test_* (doesnt trigger mxe_gcc5 build)"
    - exit 1
  <<: *job-test
  allow_failure: true