Verified Commit 3549fd8e authored by Arif Ali's avatar Arif Ali
Browse files

Update to to common package builds

* Add git to the package list to install
* Use the packages built in the build stage, rather than having to rebuild again
* TODO: Get SSH working so that we don't need to worry about keys
parent ff549584
.pkg_default_options: &pkg_default_options
image: ubuntu:latest
before_script:
- apt-get -y install build-essential devscripts debhelper
only:
- master
tags:
- docker
build_deb:
stage: build
script:
- apt-get -y install build-essential devscripts debhelper git
- export VERSION=`git describe --tags --long | awk -F- '{print $1}'`
- export RELEASE=`git describe --tags --long | awk -F- '{print $2}'`
- dch -v $VERSION-$RELEASE -b -D stable "$CI_COMMIT_REF_SLUG"
......@@ -25,10 +22,6 @@ build_deb:
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}'`
- 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
- scp -o "StrictHostKeyChecking=no" debs/*.deb root@mirror.ocf.co.uk:/var/www/html/salt/formula
<<: *pkg_default_options
.pkg_default_options: &pkg_default_options
image: centos:latest
before_script:
- yum -y install rpm-build
only:
- master
tags:
- docker
build_rpm:
stage: build
script:
- yum -y install rpm-build git
- export VERSION=`git describe --tags --long | awk -F- '{print $1}'`
- export RELEASE=`git describe --tags --long | awk -F- '{print $2}'`
- cd $CI_PROJECT_DIR/.. && tar cfz /tmp/$CI_PROJECT_NAME.tgz $CI_PROJECT_NAME && cd $CI_PROJECT_DIR
......@@ -25,11 +22,7 @@ build_rpm:
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}'`
- 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
- scp -o "StrictHostKeyChecking=no" 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
......@@ -2,8 +2,6 @@
image: saltstack/centos-7-minimal
only:
- master
tags:
- docker
build_spm:
stage: build
......@@ -22,8 +20,7 @@ deploy_spm:
stage: deploy
script:
- export PROJ_NAME=`echo $CI_PROJECT_NAME | cut -d - -f 3-`
- 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
- scp -o "StrictHostKeyChecking=no" spms/$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
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