Commit b63a9359 authored by Aleksey Shirokih's avatar Aleksey Shirokih
Browse files

move to packages

parent 654bd899
Pipeline #161 failed with stages
in 9 seconds
variables: variables:
PROXY: http://192.168.60.21:3128 PROXY: http://192.168.60.21:3128
S3_BASE: https://s3.getnoc.com S3_BASE: https://s3.repo.getnoc.com/
S3_BUCKET: tower S3_BUCKET: tower
stages: stages:
...@@ -10,46 +10,23 @@ stages: ...@@ -10,46 +10,23 @@ stages:
build_tgz: build_tgz:
stage: build stage: build
image: python:2.7.11-alpine image: registry.getnoc.com/infrastructure/packger:master
before_script:
- export VERSION=$(cat VERSION)
- if [ -d dist ]; then rm -R dist/*.zip; fi
script: script:
- apk add --update py-pep8 py-setuptools - make
- pep8 --ignore=E265,E266,E501,E402 .
- python setup.py sdist --format=zip
artifacts: artifacts:
paths: paths:
- dist/*.zip - dist/*
tags: tags:
- docker - docker
upload: upload:
stage: upload stage: upload
image: registry.getnoc.com/infrastructure/s3helper:master image: registry.getnoc.com/infrastructure/s3helper:v2
script: script:
- export VERSION=$(cat VERSION) - mc -q config host add cdn https://s3.repo.getnoc.com/ $AWS_ACCESS_KEY $AWS_SECRET_KEY
- export FNAME=noc-tower-${VERSION}.zip - mc cp dist/noc-tower-*.rpm cdn/rpm/7/x86_64
- /tmp/mc -q cp dist/$FNAME cdn/$S3_BUCKET/noc-tower-master.zip - mc cp dist/noc-tower-*.deb cdn/apt/in
- if [ -n "${CI_BUILD_TAG}" ]; then /tmp/mc -q cp dist/$FNAME cdn/$S3_BUCKET/noc-tower-${VERSION}.zip; fi
- if [ -n "${CI_BUILD_TAG}" ]; then /tmp/mc -q cp dist/$FNAME cdn/$S3_BUCKET/noc-tower-latest.zip; fi
dependencies: dependencies:
- build_tgz - build_tgz
tags: tags:
- docker - docker
build_image:
stage: build_image
before_script:
- export VERSION=$(cat VERSION)
- export CONTAINER_NAME=$CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- docker build --build-arg="http_proxy=$PROXY" --build-arg="https_proxy=$PROXY" --build-arg=VERSION=${VERSION} -t $CONTAINER_NAME .
- docker push $CONTAINER_NAME
- if [ -n "${CI_BUILD_TAG}" ]; then docker tag $CONTAINER_NAME $CI_REGISTRY_IMAGE:${CI_BUILD_TAG}; docker push $CI_REGISTRY_IMAGE:${CI_BUILD_TAG}; fi
- if [ -n "${CI_BUILD_TAG}" ]; then docker tag $CONTAINER_NAME $CI_REGISTRY_IMAGE:latest; docker push $CI_REGISTRY_IMAGE:latest; fi
dependencies:
- build_tgz
tags:
- shell
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