.gitlab-ci.yml 3.9 KB
Newer Older
EKbfh's avatar
EKbfh committed
1
2
3
4
5
6
---
stages:
  - compile
  - upload

variables:
EKbfh's avatar
EKbfh committed
7
  PYTHON_VERSION_3_8: "3.8.5"
EKbfh's avatar
EKbfh committed
8
9
  S3_BASE: https://s3.getnoc.com
  S3_BUCKET: $CI_PROJECT_NAMESPACE
EKbfh's avatar
EKbfh committed
10
11
  COMPILE_FLAGS_DEB: "--with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions"
  COMPILE_FLAGS_RPM: "--with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions"
EKbfh's avatar
EKbfh committed
12

EKbfh's avatar
EKbfh committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# RedHat Family
compile_RedHat:
  extends: .base_compile
  image: centos:7
  script:
    - mkdir -p /opt/python$PYTHON_VERSION_3_8
    - >
      yum update -y -q && yum install -y -q
      curl make
      gcc openssl-devel bzip2-devel libffi-devel sqlite-devel cmake
      gdbm-devel xz-devel readline-devel  ncurses-devel zlib-devel
    - curl -o /tmp/python.tar.gz https://www.python.org/ftp/python/$PYTHON_VERSION_3_8/Python-$PYTHON_VERSION_3_8.tgz
    - tar -zxf /tmp/python.tar.gz -C /opt
    - cd /opt/Python-$PYTHON_VERSION_3_8
    - ./configure --prefix=/opt/python$PYTHON_VERSION_3_8 --enable-optimizations $COMPILE_FLAGS_RPM
    - make -s
    - make install
    - /opt/python$PYTHON_VERSION_3_8/bin/python3 -V || true
    - tar czf "${CI_PROJECT_DIR}/python${PYTHON_VERSION_3_8}.tar.gz" -C /opt/python$PYTHON_VERSION_3_8/ .

EKbfh's avatar
EKbfh committed
33
34
35
36
37
38
39
40
41
42
43
44
.base_compile:
  stage: compile
  image: debian:10
  script:
    - mkdir -p /opt/python$PYTHON_VERSION_3_8
    - >
        apt-get update -qq && apt-get install -y -qq
        curl
        build-essential
        libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev
        libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev libffi-dev uuid-dev
    - curl -o /tmp/python.tar.gz https://www.python.org/ftp/python/$PYTHON_VERSION_3_8/Python-$PYTHON_VERSION_3_8.tgz
EKbfh's avatar
EKbfh committed
45
46
47
    - tar -zxf /tmp/python.tar.gz -C /opt
    - cd /opt/Python-$PYTHON_VERSION_3_8
    - ./configure --prefix=/opt/python$PYTHON_VERSION_3_8 --enable-optimizations $COMPILE_FLAGS_DEB
EKbfh's avatar
EKbfh committed
48
49
    - make -s
    - make install
EKbfh's avatar
EKbfh committed
50
51
    - /opt/python$PYTHON_VERSION_3_8/bin/python3 -V || true
    - tar czf "${CI_PROJECT_DIR}/python${PYTHON_VERSION_3_8}.tar.gz" -C /opt/python$PYTHON_VERSION_3_8/ .
EKbfh's avatar
EKbfh committed
52
53
54
55
56
57
58
59
  artifacts:
    paths:
      - python*.tar.gz
    expire_in: 1 week
  tags:
    - docker

# Debian Family
EKbfh's avatar
EKbfh committed
60
compile_Debian_10:
EKbfh's avatar
EKbfh committed
61
62
63
  extends: .base_compile
  image: debian:10

EKbfh's avatar
EKbfh committed
64
65
66
67
compile_Debian_9:
  extends: .base_compile
  image: debian:9

EKbfh's avatar
EKbfh committed
68
69
70
# Ubuntu Family
compile_Ubuntu_16:
  extends: .base_compile
EKbfh's avatar
EKbfh committed
71
  image: ubuntu:16.04
EKbfh's avatar
EKbfh committed
72
73
74

compile_Ubuntu_18:
  extends: .base_compile
EKbfh's avatar
EKbfh committed
75
  image: ubuntu:18.04
EKbfh's avatar
EKbfh committed
76
77
78

compile_Ubuntu_20:
  extends: .base_compile
EKbfh's avatar
EKbfh committed
79
  image: ubuntu:20.04
EKbfh's avatar
EKbfh committed
80

EKbfh's avatar
EKbfh committed
81
.base_upload:
EKbfh's avatar
EKbfh committed
82
83
  stage: upload
  image: registry.getnoc.com/infrastructure/s3helper:master
EKbfh's avatar
EKbfh committed
84
  before_script:
EKbfh's avatar
EKbfh committed
85
    - sha1sum python${PYTHON_VERSION_3_8}.tar.gz | awk '{ print $1 }' > python${PYTHON_VERSION_3_8}.tar.gz_SHA1SUMS
EKbfh's avatar
EKbfh committed
86
87
  tags:
    - docker
EKbfh's avatar
EKbfh committed
88
89
90
  rules:
    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
      when: always
EKbfh's avatar
EKbfh committed
91
92

upload_RedHat:
EKbfh's avatar
EKbfh committed
93
  extends: .base_upload
EKbfh's avatar
EKbfh committed
94
  script:
EKbfh's avatar
EKbfh committed
95
    - /tmp/mc -q cp python${PYTHON_VERSION_3_8}.* cdn/$S3_BUCKET/repo/RedHat/7/
EKbfh's avatar
EKbfh committed
96
  needs:
EKbfh's avatar
EKbfh committed
97
    - job: compile_RedHat
EKbfh's avatar
EKbfh committed
98
99
      artifacts: true

EKbfh's avatar
EKbfh committed
100
upload_Debian10:
EKbfh's avatar
EKbfh committed
101
  extends: .base_upload
EKbfh's avatar
EKbfh committed
102
  script:
EKbfh's avatar
EKbfh committed
103
    - /tmp/mc -q cp python${PYTHON_VERSION_3_8}.* cdn/$S3_BUCKET/repo/Debian/10/
EKbfh's avatar
EKbfh committed
104
105
106
107
108
  needs:
    - job: compile_Debian_10
      artifacts: true

upload_Debian9:
EKbfh's avatar
EKbfh committed
109
  extends: .base_upload
EKbfh's avatar
EKbfh committed
110
  script:
EKbfh's avatar
EKbfh committed
111
    - /tmp/mc -q cp python${PYTHON_VERSION_3_8}.* cdn/$S3_BUCKET/repo/Debian/9/
EKbfh's avatar
EKbfh committed
112
  needs:
EKbfh's avatar
EKbfh committed
113
    - job: compile_Debian_9
EKbfh's avatar
EKbfh committed
114
      artifacts: true
EKbfh's avatar
EKbfh committed
115
116

upload_Ubuntu16:
EKbfh's avatar
EKbfh committed
117
  extends: .base_upload
EKbfh's avatar
EKbfh committed
118
  script:
EKbfh's avatar
EKbfh committed
119
    - /tmp/mc -q cp python${PYTHON_VERSION_3_8}.* cdn/$S3_BUCKET/repo/Debian/16/
EKbfh's avatar
EKbfh committed
120
121
122
123
124
  needs:
    - job: compile_Ubuntu_16
      artifacts: true

upload_Ubuntu18:
EKbfh's avatar
EKbfh committed
125
  extends: .base_upload
EKbfh's avatar
EKbfh committed
126
  script:
EKbfh's avatar
EKbfh committed
127
    - /tmp/mc -q cp python${PYTHON_VERSION_3_8}.* cdn/$S3_BUCKET/repo/Debian/18/
EKbfh's avatar
EKbfh committed
128
129
130
131
132
  needs:
    - job: compile_Ubuntu_18
      artifacts: true

upload_Ubuntu20:
EKbfh's avatar
EKbfh committed
133
  extends: .base_upload
EKbfh's avatar
EKbfh committed
134
  script:
EKbfh's avatar
EKbfh committed
135
    - /tmp/mc -q cp python${PYTHON_VERSION_3_8}.* cdn/$S3_BUCKET/repo/Debian/20/
EKbfh's avatar
EKbfh committed
136
137
138
  needs:
    - job: compile_Ubuntu_20
      artifacts: true