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

EKbfh's avatar
EKbfh committed
6
7
8
9
10
.parallel:
  parallel:
    matrix:
      - PYTHON_VERSION_3: [ "3.8.13", "3.9.12", "3.10.4" ]

EKbfh's avatar
EKbfh committed
11
12
13
variables:
  S3_BASE: https://s3.getnoc.com
  S3_BUCKET: $CI_PROJECT_NAMESPACE
EKbfh's avatar
EKbfh committed
14
15
  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
16

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

EKbfh's avatar
EKbfh committed
37
.base_compile:
EKbfh's avatar
EKbfh committed
38
  extends: .parallel
EKbfh's avatar
EKbfh committed
39
40
41
  stage: compile
  image: debian:10
  script:
EKbfh's avatar
EKbfh committed
42
    - mkdir -p /opt/python$PYTHON_VERSION_3
EKbfh's avatar
EKbfh committed
43
44
45
46
47
48
    - >
        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
EKbfh's avatar
EKbfh committed
49
    - curl -o /tmp/python.tar.gz https://www.python.org/ftp/python/$PYTHON_VERSION_3/Python-$PYTHON_VERSION_3.tgz
EKbfh's avatar
EKbfh committed
50
    - tar -zxf /tmp/python.tar.gz -C /opt
EKbfh's avatar
EKbfh committed
51
52
    - cd /opt/Python-$PYTHON_VERSION_3
    - ./configure --prefix=/opt/python$PYTHON_VERSION_3 --enable-optimizations $COMPILE_FLAGS_DEB
EKbfh's avatar
EKbfh committed
53
54
    - make -s
    - make install
EKbfh's avatar
EKbfh committed
55
56
    - /opt/python$PYTHON_VERSION_3/bin/python3 -V || true
    - tar czf "${CI_PROJECT_DIR}/python${PYTHON_VERSION_3}.tar.gz" -C /opt/python$PYTHON_VERSION_3/ .
EKbfh's avatar
EKbfh committed
57
58
59
60
61
62
63
64
  artifacts:
    paths:
      - python*.tar.gz
    expire_in: 1 week
  tags:
    - docker

# Debian Family
EKbfh's avatar
Add 3.9    
EKbfh committed
65
66
67
68
compile_Debian_11:
  extends: .base_compile
  image: debian:11

EKbfh's avatar
EKbfh committed
69
compile_Debian_10:
EKbfh's avatar
EKbfh committed
70
71
72
  extends: .base_compile
  image: debian:10

EKbfh's avatar
EKbfh committed
73
74
75
76
compile_Debian_9:
  extends: .base_compile
  image: debian:9

EKbfh's avatar
EKbfh committed
77
78
79
# Ubuntu Family
compile_Ubuntu_16:
  extends: .base_compile
EKbfh's avatar
EKbfh committed
80
  image: ubuntu:16.04
EKbfh's avatar
EKbfh committed
81
82
83

compile_Ubuntu_18:
  extends: .base_compile
EKbfh's avatar
EKbfh committed
84
  image: ubuntu:18.04
EKbfh's avatar
EKbfh committed
85
86
87

compile_Ubuntu_20:
  extends: .base_compile
EKbfh's avatar
EKbfh committed
88
  image: ubuntu:20.04
EKbfh's avatar
EKbfh committed
89

EKbfh's avatar
EKbfh committed
90
.base_upload:
EKbfh's avatar
EKbfh committed
91
  extends: .parallel
EKbfh's avatar
EKbfh committed
92
93
  stage: upload
  image: registry.getnoc.com/infrastructure/s3helper:master
EKbfh's avatar
EKbfh committed
94
  before_script:
EKbfh's avatar
EKbfh committed
95
    - sha1sum python${PYTHON_VERSION_3}.tar.gz | awk '{ print $1 }' > python${PYTHON_VERSION_3}.tar.gz_SHA1SUMS
EKbfh's avatar
EKbfh committed
96
97
  tags:
    - docker
EKbfh's avatar
EKbfh committed
98
99
100
  rules:
    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
      when: always
EKbfh's avatar
EKbfh committed
101
102

upload_RedHat:
EKbfh's avatar
EKbfh committed
103
  extends: .base_upload
EKbfh's avatar
EKbfh committed
104
  script:
EKbfh's avatar
EKbfh committed
105
    - /tmp/mc -q cp python${PYTHON_VERSION_3}.* cdn/$S3_BUCKET/repo/RedHat/7/
EKbfh's avatar
EKbfh committed
106
  needs:
EKbfh's avatar
EKbfh committed
107
    - job: compile_RedHat
EKbfh's avatar
EKbfh committed
108
109
      artifacts: true

EKbfh's avatar
Add 3.9    
EKbfh committed
110
111
112
113
114
115
116
117
upload_Debian11:
  extends: .base_upload
  script:
    - /tmp/mc -q cp python${PYTHON_VERSION_3}.* cdn/$S3_BUCKET/repo/Debian/11/
  needs:
    - job: compile_Debian_11
      artifacts: true

EKbfh's avatar
EKbfh committed
118
upload_Debian10:
EKbfh's avatar
EKbfh committed
119
  extends: .base_upload
EKbfh's avatar
EKbfh committed
120
  script:
EKbfh's avatar
EKbfh committed
121
    - /tmp/mc -q cp python${PYTHON_VERSION_3}.* cdn/$S3_BUCKET/repo/Debian/10/
EKbfh's avatar
EKbfh committed
122
123
124
125
126
  needs:
    - job: compile_Debian_10
      artifacts: true

upload_Debian9:
EKbfh's avatar
EKbfh committed
127
  extends: .base_upload
EKbfh's avatar
EKbfh committed
128
  script:
EKbfh's avatar
EKbfh committed
129
    - /tmp/mc -q cp python${PYTHON_VERSION_3}.* cdn/$S3_BUCKET/repo/Debian/9/
EKbfh's avatar
EKbfh committed
130
  needs:
EKbfh's avatar
EKbfh committed
131
    - job: compile_Debian_9
EKbfh's avatar
EKbfh committed
132
      artifacts: true
EKbfh's avatar
EKbfh committed
133
134

upload_Ubuntu16:
EKbfh's avatar
EKbfh committed
135
  extends: .base_upload
EKbfh's avatar
EKbfh committed
136
  script:
EKbfh's avatar
EKbfh committed
137
    - /tmp/mc -q cp python${PYTHON_VERSION_3}.* cdn/$S3_BUCKET/repo/Debian/16/
EKbfh's avatar
EKbfh committed
138
139
140
141
142
  needs:
    - job: compile_Ubuntu_16
      artifacts: true

upload_Ubuntu18:
EKbfh's avatar
EKbfh committed
143
  extends: .base_upload
EKbfh's avatar
EKbfh committed
144
  script:
EKbfh's avatar
EKbfh committed
145
    - /tmp/mc -q cp python${PYTHON_VERSION_3}.* cdn/$S3_BUCKET/repo/Debian/18/
EKbfh's avatar
EKbfh committed
146
147
148
149
150
  needs:
    - job: compile_Ubuntu_18
      artifacts: true

upload_Ubuntu20:
EKbfh's avatar
EKbfh committed
151
  extends: .base_upload
EKbfh's avatar
EKbfh committed
152
  script:
EKbfh's avatar
EKbfh committed
153
    - /tmp/mc -q cp python${PYTHON_VERSION_3}.* cdn/$S3_BUCKET/repo/Debian/20/
EKbfh's avatar
EKbfh committed
154
155
156
  needs:
    - job: compile_Ubuntu_20
      artifacts: true