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