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

variables:
  PYTHON_VERSION_3_8: "3.8.3"
  S3_BASE: https://s3.getnoc.com
  S3_BUCKET: $CI_PROJECT_NAMESPACE
EKbfh's avatar
EKbfh committed
10
11
  COMPILE_FLAGS_DEB: "--with-lto --with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions"
  COMPILE_FLAGS_RPM: "--with-lto --with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions"
EKbfh's avatar
EKbfh committed
12
13
14
15
16
17
18
19
20
21
22
23
24

.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
25
26
27
    - 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
28
29
    - make -s
    - make install
EKbfh's avatar
EKbfh committed
30
31
    - /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
32
33
34
35
36
37
38
39
  artifacts:
    paths:
      - python*.tar.gz
    expire_in: 1 week
  tags:
    - docker

# Debian Family
EKbfh's avatar
EKbfh committed
40
compile_Debian_10:
EKbfh's avatar
EKbfh committed
41
42
43
  extends: .base_compile
  image: debian:10

EKbfh's avatar
EKbfh committed
44
45
46
47
compile_Debian_9:
  extends: .base_compile
  image: debian:9

EKbfh's avatar
EKbfh committed
48
# RedHat Family
EKbfh's avatar
EKbfh committed
49
compile_RedHat:
EKbfh's avatar
EKbfh committed
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
  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
    - 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
EKbfh's avatar
EKbfh committed
65
    - tar czf "${CI_PROJECT_DIR}/python${PYTHON_VERSION_3_8}.tar.gz" -C /opt/python$PYTHON_VERSION_3_8/ .
EKbfh's avatar
EKbfh committed
66
67
68
69
70
71

upload_RedHat:
  stage: upload
  image: registry.getnoc.com/infrastructure/s3helper:master
  script:
    - ls -al
EKbfh's avatar
EKbfh committed
72
    - /tmp/mc -q cp python${PYTHON_VERSION_3_8}.tar.gz cdn/$S3_BUCKET/repo/RedHat/7/
EKbfh's avatar
EKbfh committed
73
  needs:
EKbfh's avatar
EKbfh committed
74
    - job: compile_RedHat
EKbfh's avatar
EKbfh committed
75
76
77
78
      artifacts: true
  tags:
    - docker

EKbfh's avatar
EKbfh committed
79
80
81
82
83
84
85
86
87
88
89
90
91
upload_Debian10:
  stage: upload
  image: registry.getnoc.com/infrastructure/s3helper:master
  script:
    - ls -al
    - /tmp/mc -q cp python${PYTHON_VERSION_3_8}.tar.gz cdn/$S3_BUCKET/repo/Debian/10/
  needs:
    - job: compile_Debian_10
      artifacts: true
  tags:
    - docker

upload_Debian9:
EKbfh's avatar
EKbfh committed
92
93
94
95
  stage: upload
  image: registry.getnoc.com/infrastructure/s3helper:master
  script:
    - ls -al
EKbfh's avatar
EKbfh committed
96
    - /tmp/mc -q cp python${PYTHON_VERSION_3_8}.tar.gz cdn/$S3_BUCKET/repo/Debian/9/
EKbfh's avatar
EKbfh committed
97
  needs:
EKbfh's avatar
EKbfh committed
98
    - job: compile_Debian_9
EKbfh's avatar
EKbfh committed
99
100
101
      artifacts: true
  tags:
    - docker