Skip to content
Snippets Groups Projects
Commit 5c8b1831 authored by Chrysoula Dikonimaki's avatar Chrysoula Dikonimaki
Browse files

squashfs test

parent 981fb46f
No related branches found
No related tags found
1 merge request!12Add a squashfs package
Pipeline #6962723 failed
# This variable can be defined here or, if it needs to be hidden, as a secure variable of the project # This variable can be defined here or, if it needs to be hidden, as a secure variable of the project
variables: variables:
# Important as the default is xrdcp which doens't preserve file permissions # Important as the default is xrdcp which doens't preserve file permissions
METHOD: rsync METHOD: rsync
.master_variables: &master_variables
.master_variables: &master_variables EOS_PATH: "/eos/user/o/okdtests/webeos-tests/"
EOS_PATH: "/eos/user/o/okdtests/webeos-tests/" .dev_variables: &dev_variables
EOS_PATH: "/eos/user/o/okdtests/dev-webeos-tests/"
.common_variables: &common_variables
SSH_SERVER_HOSTKEYS: lxplus ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTA/5AzXgbkSapknIPDoEePTM1PzIBSiyDnpZihdDXKzm8UdXxCDJLUVjBwc1JfBjnaXPEeBKZDuozDss/m98m5qQu+s2Dks000V8cUFTU+BFotzRWX0jWSBpmzse0477b40X2XCPqX0Cqfx9yHdkuMlyF0kJRxXgsGTcwzwbmvqNHJdHHYJJz93hGpBhYMREcDN5VOxXz6Ack3X7xfF29xaC91oOAqq75O11LXF5Y4kAeN9kDG8o6Zsqk4c5at5aqWqzZfnnVtGjhkgU2Mt5aKwptaFMe0Z3ys/zZM4SnsE9NfompnnWsiKk2y09UvrbzuYPWLt43Fp3+IFqRJvBX
.dev_variables: &dev_variables
EOS_PATH: "/eos/user/o/okdtests/dev-webeos-tests/"
stages: stages:
- copy - copy
- deploy - deploy
- squashfs
# Copy repo content to folder that is going to be sent to eos # Copy repo content to folder that is going to be sent to eos
copy: copy:
stage: copy stage: copy
before_script: before_script:
- yum install -y rsync && yum clean all - yum install -y rsync && yum clean all
script: script:
# Create a directory where to move the output generated # Create a directory where to move the output generated
- mkdir public - mkdir public
# This is an important step as it allows the artifact to NOT # This is an important step as it allows the artifact to NOT
# include the .git subfolder from the directory where project # include the .git subfolder from the directory where project
# was checked out by CI runners, since cp * will skip the .git folder. # was checked out by CI runners, since cp * will skip the .git folder.
- rsync -a --exclude 'public' --exclude '.git' * public/ - rsync -a --exclude 'public' --exclude '.git' * public/
artifacts: artifacts:
paths: paths:
# Upload as an artifact the folder where the output has been generated # Upload as an artifact the folder where the output has been generated
# This will attach to the job the output. It can be browsed or downloaded # This will attach to the job the output. It can be browsed or downloaded
- public - public
# Make it vanish in 1 hour # Make it vanish in 1 hour
expire_in: 1 hour expire_in: 1 hour
# Deploy to an EOS folder the contents generated # Deploy to an EOS folder the contents generated
.base_deploy: &base_deploy .base_deploy: &base_deploy
# Executed during the deploy stage # Executed during the deploy stage
stage: deploy stage: deploy
# Custom docker image providing the needed tools to deploy in EOS # Custom docker image providing the needed tools to deploy in EOS
image: gitlab-registry.cern.ch/ci-tools/ci-web-deployer:latest image: gitlab-registry.cern.ch/ci-tools/ci-web-deployer:latest
script: script:
# Script that performs the deploy to EOS. Makes use of the variables defined in the project # Script that performs the deploy to EOS. Makes use of the variables defined in the project
# It will copy the generated content to the folder in EOS # It will copy the generated content to the folder in EOS
- deploy-eos - deploy-eos
# do not run any globally defined before_script or after_script for this step # do not run any globally defined before_script or after_script for this step
before_script: [] before_script: []
after_script: [] after_script: []
# Create squashfs package in an EOS folder
.add_squashfs: &add_squashfs
stage: squashfs
before_script:
- mkdir -p ~/.ssh
# validate lxplus's SSH key
- 'echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts'
# tell SSH to forward Kerberos credentials so lxplus can access AFS/EOS on behalf of the user
- 'echo -e "Host *\n\tGSSAPIDelegateCredentials yes\n\tGSSAPITrustDNS yes\n\n" > ~/.ssh/config'
script:
- PACKAGE_DIR=squashfs/package
- CONTENT_DIR=cgi-folder
# make sure to get a forwardable Kerberos ticket so lxplus can access AFS/EOS on behalf of the user
- echo "${EOS_ACCOUNT_PASSWORD}" | kinit -f ${EOS_ACCOUNT_USERNAME}@CERN.CH
- ssh ${EOS_ACCOUNT_USERNAME}@lxplus "bash -s" < ./.gitlab/squashfs.sh $EOS_PATH $PACKAGE_DIR $CONTENT_DIR
#- ssh ${EOS_ACCOUNT_USERNAME}@lxplus "eos root://eoshome-a.cern.ch squash new $EOS_PATH$PACKAGE_DIR"
#- ssh ${EOS_ACCOUNT_USERNAME}@lxplus "cp -r $EOS_PATH$CONTENT_DIR/. $EOS_PATH$PACKAGE_DIR/"
#- ssh ${EOS_ACCOUNT_USERNAME}@lxplus "eos root://eoshome-a.cern.ch squash pack $EOS_PATH$PACKAGE_DIR"
Test squashfs:
<<: *add_squashfs
variables:
<<: *dev_variables
<<: *common_variables
squashfs:
<<: *add_squashfs
variables:
<<: *master_variables
<<: *common_variables
only:
- master
Test deploy: Test deploy:
<<: *base_deploy <<: *base_deploy
variables: variables:
<<: *dev_variables <<: *dev_variables
Deploy: Deploy:
<<: *base_deploy <<: *base_deploy
only: only:
- master - master
variables: variables:
<<: *master_variables <<: *master_variables
\ No newline at end of file
# Create squashfs package with the contents of a EOS directory in an EOS path
# Input:
# $1: The EOS path
# $2: The subdirectory of the package
# $3: The subdirectory to copy into the package
echo "Params given as input: "
echo "EOS path: $1"
echo "Package directory: $2"
echo "Content directory: $3"
eos root://eoshome-a.cern.ch squash new $1$2
cp -r $1$3/. $1$2/
eos root://eoshome-a.cern.ch squash pack $1$2
Options FollowSymlinks
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment