Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Philipp Hahn <pmhahn+btrfs@pmhahn.de>
To: "Lakshmipathi.G" <lakshmipathi.ganapathi@collabora.com>,
	linux-btrfs@vger.kernel.org
Cc: dsterba@suse.com, thecybershadow@gmail.com, wqu@suse.com,
	lakshmipathi.g@giis.co.in
Subject: Re: [PATCH] Setup GitLab-CI for btrfs-progs
Date: Tue, 1 Oct 2019 08:02:29 +0200	[thread overview]
Message-ID: <1ecbc32d-9f28-b0f5-bf2d-8ceee12d6404@pmhahn.de> (raw)
In-Reply-To: <20190930165622.GA25114@giis.co.in>

Hi,

I'm not yet a GitLab expert myself, but AFAIK ...

Am 30.09.19 um 18:56 schrieb Lakshmipathi.G:
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> new file mode 100644
> index 0000000..2afde50
> --- /dev/null
> +++ b/.gitlab-ci.yml
> @@ -0,0 +1,181 @@
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public
> +# License v2 as published by the Free Software Foundation.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +# General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public
> +# License along with this program; if not, write to the
> +# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
> +# Boston, MA 021110-1307, USA.
> +#
> +
> +image: docker:18.09.7
> +
> +services:
> +    - docker:18.09.7-dind
> +
> +variables:
> +  DOCKER_DRIVER: overlay2
> +
> +stages:
> +  - build
> +  - btrfs-progs build
> +  - test
> +
> +variables:

You already have a "variables" section above - merge them?

> +  DOCKER_DRIVER: overlay2
> +  IMAGE_TAG: registry.gitlab.com/$CI_PROJECT_NAMESPACE/btrfs-progs:gitlab-ci
> +
> +before_script:
> +   - docker login --username $CI_REGISTRY_USER --password $CI_REGISTRY_PASSWORD $CI_REGISTRY
> +
> +docker build:
> +  stage: build
> +  script:
> +    - cd gitlab-ci
> +    - docker pull $IMAGE_TAG > /dev/null && echo "Downloaded image" || ( docker build -t $IMAGE_TAG . && docker push $IMAGE_TAG )
> +    - cd ..
> +
> +## To enable or disable Kernel Build set BUILD_KERNEL: "1" or BUILD_KERNEL: "0" 
> +## If you disable Kernel Build, make sure PREBUILT_KERNEL_ID points to previously built the kernel job id.
> +
> +kernel build:
> +  variables:
> +    BUILD_KERNEL: "1"
> +    PREBUILT_KERNEL_ID: "288159334"
> +  before_script:
> +    - apk add curl unzip 
> +  stage: build
> +  services:
> +    - docker:18.09.7-dind

You already have "services" defined globally - no need to repeat that
here again.

> +  script:
> +     - if [ "$BUILD_KERNEL" == "1" ]; then
> +         docker run --cap-add SYS_PTRACE --cap-add sys_admin --privileged --device=/dev/kvm -v $PWD:/repo $IMAGE_TAG /repo/gitlab-ci/kernel_build.sh;
> +       else
> +         curl -o bzImage.zip --location --header "JOB-TOKEN:$CI_JOB_TOKEN"  "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/jobs/$PREBUILT_KERNEL_ID/artifacts" && unzip bzImage.zip;
> +       fi;
> +  artifacts:
> +    when: always
> +    paths:
> +      - bzImage
> +
> +# To enable or disable image build update BUILD_IMAGE value to "1" or "0".
> +# If you disable Image Build, make sure PREBUILT_IMAGE_ID points to previously built rootfs job id.
> + 
> +image build:
> +  variables:
> +    BUILD_IMAGE: "1"
> +    PREBUILT_IMAGE_ID: "288506168"
> +  before_script:
> +    - apk add curl unzip 
> +  stage: build
> +  services:
> +    - docker:18.09.7-dind

dito

> +  script:
> +     - if [ "$BUILD_IMAGE" == "1" ]; then
> +          docker run --cap-add SYS_PTRACE --cap-add sys_admin --privileged --device=/dev/kvm -v $PWD:/repo $IMAGE_TAG /repo/gitlab-ci/setup_image.sh;
> +       else
> +          curl  -o qemu-image.img.zip --location --header "JOB-TOKEN:$CI_JOB_TOKEN" "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/jobs/$PREBUILT_IMAGE_ID/artifacts" && unzip qemu-image.img.zip;
> +       fi;
> +  artifacts:
> +    when: always
> +    paths:
> +      - qemu-image.img
> +
> +btrfs-progs build:
> +  stage: btrfs-progs build
> +  services:
> +    - docker:18.09.7-dind

dito

> +  script:
> +     - docker run --cap-add SYS_PTRACE --cap-add sys_admin --privileged --device=/dev/kvm -v $PWD:/repo $IMAGE_TAG /repo/gitlab-ci/run_tests.sh
> +  artifacts:
> +    expire_in: 1 week
> +    when: always
> +    paths:
> +      - qemu-image.img
> +
> +cli tests:
> +  stage: test
> +  services:
> +    - docker:18.09.7-dind

dito

> +  script:
> +     - echo "./cli-tests.sh" > $PWD/cmd
> +     - docker run --cap-add SYS_PTRACE --cap-add sys_admin --privileged --device=/dev/kvm -v $PWD:/repo $IMAGE_TAG /repo/gitlab-ci/run_tests.sh
> +     - test -e "result" || exit 1 # If result doesn't exists, job failed.
> +  artifacts:
> +    when: always
> +    paths:
> +      - "*tests-results.txt"
> +
> +convert tests:
> +  only: 
> +    - devel
> +  stage: test
> +  services:
> +    - docker:18.09.7-dind

dito

> +  script:
> +     - echo "./convert-tests.sh" > $PWD/cmd
> +     - docker run --cap-add SYS_PTRACE --cap-add sys_admin --privileged --device=/dev/kvm -v $PWD:/repo $IMAGE_TAG /repo/gitlab-ci/run_tests.sh
> +     - test -e "result" || exit 1
> +  artifacts:
> +    when: always
> +    paths:
> +      - "*tests-results.txt"
> +
> +fsck tests:
> +  stage: test
> +  services:
> +    - docker:18.09.7-dind

dito

> +  script:
> +     - echo "./fsck-tests.sh" > $PWD/cmd
> +     - docker run --cap-add SYS_PTRACE --cap-add sys_admin --privileged --device=/dev/kvm -v $PWD:/repo $IMAGE_TAG /repo/gitlab-ci/run_tests.sh
> +     - test -e "result" || exit 1
> +  artifacts:
> +    when: always
> +    paths:
> +      - "*tests-results.txt"
> +      - error.log
> +
> +fuzz tests:
> +  stage: test
> +  services:
> +    - docker:18.09.7-dind

dito

> +  script:
> +     - echo "./fuzz-tests.sh" > $PWD/cmd
> +     - docker run --cap-add SYS_PTRACE --cap-add sys_admin --privileged --device=/dev/kvm -v $PWD:/repo $IMAGE_TAG /repo/gitlab-ci/run_tests.sh
> +     - test -e "result" || exit 1
> +  artifacts:
> +    when: always
> +    paths:
> +      - "*tests-results.txt"
> +
> +misc tests:
> +  stage: test
> +  services:
> +    - docker:18.09.7-dind

dito

> +  script:
> +     - echo "./misc-tests.sh" > $PWD/cmd
> +     - docker run --cap-add SYS_PTRACE --cap-add sys_admin --privileged --device=/dev/kvm -v $PWD:/repo $IMAGE_TAG /repo/gitlab-ci/run_tests.sh
> +     - test -e "result" || exit 1
> +  artifacts:
> +    when: always
> +    paths:
> +      - "*tests-results.txt"
> +
> +mkfs tests:
> +  stage: test
> +  services:
> +    - docker:18.09.7-dind

dito

> +  script:
> +     - echo "./mkfs-tests.sh" > $PWD/cmd
> +     - docker run --cap-add SYS_PTRACE --cap-add sys_admin --privileged --device=/dev/kvm -v $PWD:/repo $IMAGE_TAG /repo/gitlab-ci/run_tests.sh
> +     - test -e "result" || exit 1
> +  artifacts:
> +    when: always
> +    paths:
> +      - "*tests-results.txt"
> +

Philipp

  reply	other threads:[~2019-10-01  6:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-30 16:56 [PATCH] Setup GitLab-CI for btrfs-progs Lakshmipathi.G
2019-10-01  6:02 ` Philipp Hahn [this message]
2019-10-07  3:25   ` Lakshmipathi.G
2019-10-07 17:52 ` David Sterba
2019-10-14 18:02   ` Lakshmipathi.G

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1ecbc32d-9f28-b0f5-bf2d-8ceee12d6404@pmhahn.de \
    --to=pmhahn+btrfs@pmhahn.de \
    --cc=dsterba@suse.com \
    --cc=lakshmipathi.g@giis.co.in \
    --cc=lakshmipathi.ganapathi@collabora.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=thecybershadow@gmail.com \
    --cc=wqu@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox