Verified Commit 9636fb50 authored by Arif Ali's avatar Arif Ali
Browse files

Now using the docker method

parent 077d92cc
.pkg_default_options: &pkg_default_options
image: ubuntu:latest
before_script:
- rm -rf $CI_PROJECT_DIR/debs
- rm -rf /tmp/$CI_PROJECT_NAME.tgz
- rm -rf $CI_PROJECT_DIR/../*.deb
after_script:
- rm -rf /tmp/$CI_PROJECT_NAME.tgz
- rm -rf $CI_PROJECT_DIR/../*.deb
- apt -y install build-essential devscripts debhelper
only:
- master
tags:
- docker
build_deb:
stage: build
script:
- export VERSION=`git describe --tags --long | awk -F- '{print $1}'`
- export RELEASE=`git describe --tags --long | awk -F- '{print $2}'`
- sudo apt-get -y install build-essential devscripts debhelper
- dch -v $VERSION-$RELEASE -b -D stable "$CI_COMMIT_REF_SLUG"
- dpkg-buildpackage -uc -us
- mkdir -p $CI_PROJECT_DIR/debs
......@@ -22,23 +21,14 @@ build_deb:
- debs/*.deb
expire_in: 7 day
<<: *pkg_default_options
only:
- master
tags:
- debs
deploy_deb:
stage: deploy
script:
- export VERSION=`git describe --tags --long | awk -F- '{print $1}'`
- export RELEASE=`git describe --tags --long | awk -F- '{print $2}'`
- sudo apt-get -y install build-essential devscripts debhelper
- dch -v $VERSION-$RELEASE -b -D stable "$CI_COMMIT_REF_SLUG"
- dpkg-buildpackage -uc -us
- ssh -o "StrictHostKeyChecking=no" root@mirror.ocf.co.uk "cd /var/www/html/salt/formula ; rm -rf $CI_PROJECT_NAME*.deb"
- scp -o "StrictHostKeyChecking=no" ../*.deb root@mirror.ocf.co.uk:/var/www/html/salt/formula
<<: *pkg_default_options
only:
- master
tags:
- debs
.pkg_default_options: &pkg_default_options
image: centos:latest
before_script:
- rm -rf $CI_PROJECT_DIR/rpms
- rm -rf /tmp/$CI_PROJECT_NAME.tgz
- rm -rf $HOME/rpmbuild/RPMS/*/$CI_PROJECT_NAME*.rpm
after_script:
- rm -rf /tmp/$CI_PROJECT_NAME.tgz
- rm -rf $HOME/rpmbuild/RPMS/*/$CI_PROJECT_NAME*.rpm
- yum -y install rpm-build
only:
- master
tags:
- docker
build_rpm:
stage: build
script:
- export VERSION=`git describe --tags --long | awk -F- '{print $1}'`
- export RELEASE=`git describe --tags --long | awk -F- '{print $2}'`
- sudo yum -y install rpm-build
- cd $CI_PROJECT_DIR/.. && tar cfz /tmp/$CI_PROJECT_NAME.tgz $CI_PROJECT_NAME && cd $CI_PROJECT_DIR
- rpmbuild -ta --define "version $VERSION" --define "release $RELEASE" /tmp/$CI_PROJECT_NAME.tgz
- mkdir -p $CI_PROJECT_DIR/rpms
......@@ -22,24 +21,15 @@ build_rpm:
- rpms/*.rpm
expire_in: 7 day
<<: *pkg_default_options
only:
- master
tags:
- el7
deploy_rpm:
stage: deploy
script:
- export VERSION=`git describe --tags --long | awk -F- '{print $1}'`
- export RELEASE=`git describe --tags --long | awk -F- '{print $2}'`
- sudo yum -y install rpm-build
- cd $CI_PROJECT_DIR/.. && tar cfz /tmp/$CI_PROJECT_NAME.tgz $CI_PROJECT_NAME && cd $CI_PROJECT_DIR
- rpmbuild -ta --define "version $VERSION" --define "release $RELEASE" /tmp/$CI_PROJECT_NAME.tgz
- ssh -o "StrictHostKeyChecking=no" root@mirror.ocf.co.uk "cd /var/www/html/salt/formula ; rm -rf $CI_PROJECT_NAME*.rpm"
- scp -o "StrictHostKeyChecking=no" $HOME/rpmbuild/RPMS/*/$CI_PROJECT_NAME*.rpm root@mirror.ocf.co.uk:/var/www/html/salt/formula
- ssh -o "StrictHostKeyChecking=no" root@mirror.ocf.co.uk "cd /var/www/html/salt/formula ; createrepo ."
<<: *pkg_default_options
only:
- master
tags:
- el7
.pkg_default_options: &pkg_default_options
before_script:
- rm -rf $CI_PROJECT_DIR/spms
- rm -rf /tmp/$CI_PROJECT_NAME.tgz
- rm -rf /srv/spm_build/$CI_PROJECT_NAME*.spm
after_script:
- rm -rf /tmp/$CI_PROJECT_NAME.tgz
- rm -rf /srv/spm_build/$CI_PROJECT_NAME*.spm
image: saltstack/centos-7-minimal
only:
- master
tags:
- docker
build_spm:
stage: build
script:
- export PROJ_NAME=`echo $CI_PROJECT_NAME | cut -d - -f 3-`
- sudo yum -y install salt
- sudo spm build . -c etc
- mkdir -p spms
- cp /srv/spm_build/$PROJ_NAME*.spm spms/.
......@@ -20,22 +17,13 @@ build_spm:
- spms/*.spm
expire_in: 7 day
<<: *pkg_default_options
only:
- master
tags:
- el7
deploy_spm:
stage: deploy
script:
- export PROJ_NAME=`echo $CI_PROJECT_NAME | cut -d - -f 3-`
- sudo yum -y install salt
- sudo spm build . -c etc
- ssh -o "StrictHostKeyChecking=no" root@mirror.ocf.co.uk "cd /var/www/html/salt/formula ; rm -rf $PROJ_NAME*.spm"
- scp -o "StrictHostKeyChecking=no" /srv/spm_build/$PROJ_NAME*.spm root@mirror.ocf.co.uk:/var/www/html/salt/formula
- ssh -o "StrictHostKeyChecking=no" root@mirror.ocf.co.uk "cd /var/www/html/salt/formula ; spm create_repo ."
<<: *pkg_default_options
only:
- master
tags:
- el7
Markdown is supported
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