Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: build rpm package for pouch #597

Merged
merged 1 commit into from
Jan 19, 2018

Conversation

zzchun
Copy link
Contributor

@zzchun zzchun commented Jan 17, 2018

Signed-off-by: Zhanchun Zhang zzchun@zju.edu.cn

1.Describe what this PR did
This pr added a way to build rpm package

2.Does this pull request fix one issue?
fixes part of #67

3.Describe how you did it

  1. Build pouch:rpm image
    cd hack/package/rpm
    docker build -t pouch:rpm .

  2. Mount a directory which contains gpg keys, eg
    $ tree rpm/keys/
    rpm/keys/
    ├── gpg
    └── secretkey

  3. Run the following command, and enter your pass phrase to sign rpm package
    docker run -it -v /root/rpm/:/root/rpm pouch:rpm bash -c hack/package/build.sh

  4. In this example rpm package will be output in '/root/rpm/package/' directory

4.Describe how to verify it

5.Special notes for reviews

@allencloud
Copy link
Collaborator

Thanks a lot for your work, @zzchun
We will review this soon. 👍

@codecov-io
Copy link

codecov-io commented Jan 17, 2018

Codecov Report

Merging #597 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #597   +/-   ##
=======================================
  Coverage   13.58%   13.58%           
=======================================
  Files          65       65           
  Lines        3541     3541           
=======================================
  Hits          481      481           
  Misses       3010     3010           
  Partials       50       50

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e2e2321...466a12f. Read the comment docs.

# kill only the pouch process, not all processes in the cgroup
KillMode=process

# restart the docker process if it exits prematurely
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/docker/pouch?

LimitCORE=infinity

TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/docker/pouch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry,I'll fix it

@Letty5411
Copy link
Contributor

@zzchun It would be better that there is a doc with this PR

# docker run -it -v /root/rpm/:/root/rpm pouch:rpm bash -c hack/package/build.sh
#
# 4. In this example rpm package will be output in '/root/rpm/package/' directory

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also copy this to a build.doc?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll write a doc after building deb package

PACKAGEDIR=/root/rpm/package

# the branch to build pouch
POUCH_BRANCH='0.1.x'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to change this variable to be : POUCH_BRANCH={$POUCH_BRANCH:?"Must specify pouch branch"} ? the same for VERSION

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea,I‘ll parse these parameters via env

SCRIPTSDIR=$DIR/package/rpm/scripts

POUCHDIR=$TMP/source
mkdir $POUCHDIR
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could add a rm option after each mkdir, for example

trap "rm -rf $POUCHDIR" EXIT

{
mkdir -p $LXC_DIR && pushd $LXC_DIR
git clone https://github.com/lxc/lxcfs.git
cd lxcfs && git checkout -q $LXC_TAG
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could use git clone -b?

Signed-off-by: Zhanchun Zhang <zzchun@zju.edu.cn>
@Letty5411
Copy link
Contributor

How about adding a config.tmpl, so that user could get there own configure file by modifying it ?

@zzchun
Copy link
Contributor Author

zzchun commented Jan 19, 2018

I will give an example in the build doc.
Thx @Letty5411 for your review

@Letty5411
Copy link
Contributor

@zzchun No problem, I'll merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants