stages: - test - test_brew - build_container - deploy build-meson: image: fedora:32 script: - dnf group install -y 'Development Tools' - dnf install -y hdf5-devel gsl-devel flex bison gcc-c++ - dnf install -y gtk3-devel cairo-devel pango-devel gdk-pixbuf2-devel fftw-devel libpng-devel diffutils - dnf install -y meson - meson build && ninja -C build - ninja -C build test artifacts: when: always paths: - build/meson-logs/testlog.junit.xml reports: junit: build/meson-logs/testlog.junit.xml build-meson-nohdf5: image: fedora:37 script: - dnf group install -y 'Development Tools' - dnf install -y gsl-devel flex bison gcc-c++ - dnf install -y gtk3-devel cairo-devel pango-devel gdk-pixbuf2-devel fftw-devel libpng-devel diffutils - dnf install -y meson - meson build -Dhdf5=disabled && ninja -C build - ninja -C build test artifacts: when: always paths: - build/meson-logs/testlog.junit.xml reports: junit: build/meson-logs/testlog.junit.xml build_container_image: stage: build_container only: - master image: name: gcr.io/kaniko-project/executor:debug entrypoint: [ "" ] variables: IMAGE: "crystfel" IMAGE_TAG_LATEST: "latest" IMAGE_TAG_SHA: $CI_COMMIT_SHORT_SHA DOCKER_HOST: tcp://docker:2375 DOCKER_TLS_CERTDIR: "" script: - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - > /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE/$IMAGE:$IMAGE_TAG_LATEST --destination $CI_REGISTRY_IMAGE/$IMAGE:$IMAGE_TAG_SHA --build-arg HELM_VERSION=$HELM_VERSION --build-arg RANCHER_CLI_VERSION=$RANCHER_CLI_VERSION tags: - kubernetes build_container_image_tag: stage: build_container image: name: gcr.io/kaniko-project/executor:debug entrypoint: [ "" ] variables: IMAGE: "crystfel" IMAGE_TAG_VER: $CI_COMMIT_TAG DOCKER_HOST: tcp://docker:2375 DOCKER_TLS_CERTDIR: "" script: - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - > /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE/$IMAGE:$IMAGE_TAG_VER --build-arg HELM_VERSION=$HELM_VERSION --build-arg RANCHER_CLI_VERSION=$RANCHER_CLI_VERSION tags: - kubernetes rules: - if: $CI_COMMIT_TAG build-native-macos: tags: - macOS variables: GIT_STRATEGY: clone script: - brew update - brew upgrade - brew install gsl hdf5 flex bison argp-standalone pkg-config doxygen gtk+3 cairo pango gdk-pixbuf fftw meson ninja python python-tk - export PATH="$(brew --prefix)/opt/bison/bin:$(brew --prefix)/opt/flex/bin:$PATH" - export LDFLAGS="-L$(brew --prefix)/opt/bison/lib -L$(brew --prefix)/opt/flex/lib -L$(brew --prefix)/opt/argp-standalone/lib -largp $LDFLAGS" - export CFLAGS="-I$(brew --prefix)/opt/flex/include -I$(brew --prefix)/opt/argp-standalone/include/ $CFLAGS" - meson build - ninja -C build - ninja -C build test artifacts: when: always paths: - build/meson-logs/testlog.junit.xml reports: junit: build/meson-logs/testlog.junit.xml build-brew-macos: stage: test_brew tags: - macOS variables: GIT_STRATEGY: clone script: - brew update - brew upgrade - brew install gsl hdf5 flex bison argp-standalone pkg-config doxygen gtk+3 cairo pango gdk-pixbuf fftw meson ninja python python-tk - brew uninstall -v -f crystfel - brew install -v -s ./crystfel.rb --HEAD - brew uninstall -v -f crystfel build-centos7: image: centos:centos7 #image:centos:latest #image: centos:centos7.9.2009 variables: SECURE_FILES_DOWNLOAD_PATH: './downloads' script: - yum update -y - yum group install -y "Development Tools" - yum install -y wget lz4 lz4-devel bzip2-libs bzip2-devel python3 gtk3-devel curl which libcurl-devel - curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash - python3 -m pip install meson ninja - wget https://gitlab.desy.de/thomas.white/install-crystfel/-/raw/main/run-me-desy-maxwell-centos7 - chmod 755 ./run-me-desy-maxwell-centos7 - ./run-me-desy-maxwell-centos7 --yes-really - cp -Rp /software $CI_PROJECT_DIR artifacts: paths: - software/ - temp/crystfel/build/meson-logs/testlog.junit.xml when: on_success expire_in: 1 day reports: junit: temp/crystfel/build/meson-logs/testlog.junit.xml build-deploy-local-maxwell: tags: - maxwell variables: GIT_STRATEGY: clone SECURE_FILES_DOWNLOAD_PATH: './downloads' script: - curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash - wget https://gitlab.desy.de/thomas.white/install-crystfel/-/raw/main/run-me-desy-maxwell-centos7 - chmod 755 ./run-me-desy-maxwell-centos7 - if [ -d /software/crystfel/devel ]; then mv -f /software/crystfel/devel /software/crystfel/devel-`date +%F-%H:%M:%S`; fi - module load maxwell git - ./run-me-desy-maxwell-centos7 --yes-really rules: - if: $MAXWELL_DEPLOYMENT == "local" && $CI_COMMIT_BRANCH == "master" deploy-remote-maxwell: stage: deploy image: centos:centos7 variables: GIT_STRATEGY: none tags: - DESY-intern before_script: ## ## Install ssh-agent or kerberos client if not already installed, it is required by Docker. ## (change apt-get to yum if you use an RPM-based image) ## Run ssh-agent (inside the build environment) ## Give the right permissions, otherwise ssh-add will refuse to add files ## Add the SSH key stored in MAXWELL_SSH_PRIVATE_KEY file type CI/CD variable to the agent store ## Create the SSH directory and give it the right permissions ## If MAXWELL_SSH_PRIVATE_KEY is not set then use $MAXWELL_USER_NAME and $MAXWELL_ACCOUNT_PASSWORD ## to connect using Kerberos. - yum update -y - yum install -y wget - if [ $MAXWELL_SSH_PRIVATE_KEY ]; then command -v ssh-agent >/dev/null || ( yum install openssh-clients -y ); eval $(ssh-agent -s); chmod 400 "$MAXWELL_SSH_PRIVATE_KEY"; ssh-add "$MAXWELL_SSH_PRIVATE_KEY"; mkdir -p ~/.ssh; chmod 700 ~/.ssh; else yum install -y openssh-clients krb5-workstation; echo $MAXWELL_ACCOUNT_PASSWORD | kinit $MAXWELL_USER_NAME@DESY.DE; fi - wget -q https://wims.desy.de/system/ALL_afs/etc/ssh_known_hosts2 -O ~/.ssh/known_hosts script: - ssh $MAXWELL_USER_NAME@max-wgs "if [ -d /software/crystfel/devel ]; then mv -f /software/crystfel/devel /software/crystfel/devel-`date +%F-%H:%M:%S`; fi" - scp -r software/crystfel/devel $MAXWELL_USER_NAME@max-wgs:/software/crystfel/ rules: - if: $MAXWELL_DEPLOYMENT == "remote" && $CI_COMMIT_BRANCH == "master"