Commit 214715f8 authored by sixue.cheng's avatar sixue.cheng :speech_balloon:
Browse files

Update .gitlab-ci.yml, .gitlab-template-ci.yml

No related merge requests found
Showing with 84 additions and 41 deletions
+84 -41
# This file is a template, and might need editing before it works on your project.
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
# This is a sample GitLab CI/CD configuration file that should run without any modifications.
# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts,
# it uses echo commands to simulate the pipeline execution.
#
# A pipeline is composed of independent jobs that run scripts, grouped into stages.
# Stages run in sequential order, but jobs within stages run in parallel.
#
# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages
stages:
- init_repo # List of stages for jobs,and their orderof execution
- is_update
variables:
branch_name: $CI_COMMIT_BRANCH
baseWork: /home/gitlab-runner/ubuntu-rootfs
file_name: ${branch_name}_${CI_PIPELINE_ID}
code_url: ${baseWork}/${file_name}
init_repo-job: # This job runs in the build stage, which runs first.
stage: init_repo
tags:
- shell.buildtest
script:
- cd $baseWork
- python3 gettxt.py
is_update-job: # This job runs in the build stage, which runs first.
stage: is_update
tags:
- shell.buildtest
script:
- cd $baseWork
- python3 isupdate.py
needs:
- init_repo-job
- triggers
Fedora-Minimal-Rawhide-20200108.n.0-sda.raw.xz-job:
stage: triggers
trigger:
include: .gitlab-template-ci.yml
variables:
tagname: Fedora-Minimal-Rawhide-20200108.n.0-sda.raw.xz
link: http://120.92.155.32:8082/artifactory/ci/externalOs/fedora/Fedora-Minimal-Rawhide-20200108.n.0-sda.raw.xz
date: 01 Feb 2021 06:15:10 +0000
only:
- main
- fedora-test
stages:
- test
- download
- creat-roofs
- upload-rootfs
variables:
tagname: ${tagname}
link: ${link}
date: ${date}
branch_name: $CI_COMMIT_BRANCH
baseWork: /home/gitlab-runner/fedora-rootfs
file_name: ${branch_name}_${CI_PIPELINE_ID}
code_url: ${baseWork}/${file_name}
ROOTFS_EXT4: ${CI_PIPELINE_ID}_${tagname}_rootfs.ext4
jforurl: http://120.92.155.32:8082/artifactory/ci/OS/fedora
gitcode: ssh://git@120.92.155.32:10080/tops/ops/Linux.git
ROOTFS_SIZE: 2584M
init-job:
stage: test
script:
- cd $baseWork
- rm -rf $file_name
- mkdir $file_name
- cd $file_name
# - git clone -b $branch_name $gitcode sh
# - mv sh/* .
tags:
# - shell.buildtest
# - shell.ubuntu
- shell.citest
download-job:
stage: download
script:
- cd $code_url
- python3 downloadfile.py $link
- unxz $tagname
- mkdir rootfs_origin_mount
- sudo mount "${devLoop}p4" rootfs_origin_mount
- cd rootfs_origin_mount
- sudo tar -zcf ../$tagname.rootfs.tar.gz *
- curl -uadmin:AP5ohjc77AatopcVBsY5cupHJ3J -T ../$tagname.rootfs.tar.gz http://120.92.155.32:8082/artifactory/ci/externalOs/fedora/$tagname.rootfs.tar.gz
- echo $?
- cd ..
- sudo umount rootfs_origin_mount
- sudo losetup -d ${devLoop}
tags:
# - shell.buildtest
# - shell.ubuntu
- shell.citest
needs:
- init-job
# creat-roofs-job:
# stage: creat-roofs
# script:
# - cd $code_url
# - sudo docker run --rm --name $file_name -u buildman --privileged=true -v $code_url:/home/buildman baseubuntu:v1 /bin/bash -c "cd /home/buildman && ./build.sh ${ROOTFS_EXT4} $tagname $ROOTFS_SIZE"
# tags:
# # - shell.buildtest
# # - shell.ubuntu
# - shell.citest
# needs:
# - download-job
# upload-rootfs-job:
# stage: upload-rootfs
# script:
# - cd $code_url
# - zip mini_${tagname}.zip $ROOTFS_EXT4
# - curl -uadmin:AP5ohjc77AatopcVBsY5cupHJ3J -T mini_${tagname}.zip $jforurl/mini_${tagname}.zip
# tags:
# # - shell.buildtest
# # - shell.ubuntu
# - shell.citest
# needs:
# - creat-roofs-job
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