Commit 944906ea authored by EKbfh's avatar EKbfh 🐼
Browse files

Add CI for compiling

parent e79d95d5
Pipeline #23975 passed with stages
in 26 minutes and 52 seconds
---
stages:
- compile
- upload
variables:
PYTHON_VERSION_3_8: "3.8.3"
S3_BASE: https://s3.getnoc.com
S3_BUCKET: $CI_PROJECT_NAMESPACE
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"
.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
- tar -zxf /tmp/python.tar.gz -C /opt/python$PYTHON_VERSION_3_8
- cd /opt/python$PYTHON_VERSION_3_8/Python-$PYTHON_VERSION_3_8
- ./configure --prefix=/opt/python$PYTHON_VERSION_3_8/build --enable-optimizations $COMPILE_FLAGS_DEB
- make -s
- make install
- /opt/python$PYTHON_VERSION_3_8/build/bin/python3 -V || true
- tar czf "${CI_PROJECT_DIR}/python${PYTHON_VERSION_3_8}_$CI_JOB_NAME.tar.gz" /opt/python$PYTHON_VERSION_3_8/build
artifacts:
paths:
- python*.tar.gz
expire_in: 1 week
tags:
- docker
# Debian Family
Debian:
extends: .base_compile
image: debian:10
# RedHat Family
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
- 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}_$CI_JOB_NAME.tar.gz" /opt/python$PYTHON_VERSION_3_8/
upload_RedHat:
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/RedHat/
needs:
- job: RedHat
artifacts: true
tags:
- docker
upload_Debian:
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/
needs:
- job: Debian
artifacts: true
tags:
- docker
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment