Verified Commit 077d92cc authored by Arif Ali's avatar Arif Ali
Browse files

split pkg builds to the 3 seperate files

This can ensure that we don't have to define all of them at the start, and do these in stages for any of the formulas
parent 5529d985
.pkg_default_options: &pkg_default_options
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
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
- cp ../$CI_PROJECT_NAME*.deb $CI_PROJECT_DIR/debs/.
artifacts:
paths:
- 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
before_script:
- rm -rf $CI_PROJECT_DIR/debs
- rm -rf $CI_PROJECT_DIR/rpms
- rm -rf $CI_PROJECT_DIR/spms
- rm -rf /tmp/$CI_PROJECT_NAME.tgz
- rm -rf $HOME/rpmbuild/RPMS/*/$CI_PROJECT_NAME*.rpm
- rm -rf $CI_PROJECT_DIR/../*.deb
- rm -rf /srv/spm_build/$CI_PROJECT_NAME*.spm
after_script:
- rm -rf /tmp/$CI_PROJECT_NAME.tgz
- rm -rf $HOME/rpmbuild/RPMS/*/$CI_PROJECT_NAME*.rpm
- rm -rf $CI_PROJECT_DIR/../*.deb
- rm -rf /srv/spm_build/$CI_PROJECT_NAME*.spm
build_rpm:
stage: build
......@@ -49,72 +43,3 @@ deploy_rpm:
- master
tags:
- el7
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/.
artifacts:
paths:
- 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
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
- cp ../$CI_PROJECT_NAME*.deb $CI_PROJECT_DIR/debs/.
artifacts:
paths:
- 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
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
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/.
artifacts:
paths:
- 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