Skip to content
Snippets Groups Projects
Commit 41f2ae2d authored by Alex Kanitz's avatar Alex Kanitz
Browse files

ci: add GitLab CI config

parent 00c2db18
No related branches found
No related tags found
1 merge request!5ci: add GitLab CI config
Pipeline #14469 passed
default:
tags:
- shell
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "push"
test:
rules:
- if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
script:
- export IMAGE="${DOCKER_ORG}/${DOCKER_REPO}:latest"
- docker build -t $IMAGE .
- docker run --rm $IMAGE tests/test.sh
test_and_publish:
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
script:
- export VERSION=$(grep 'version <-' ascii_alignment_pileup.R | cut -f2 -d'"')
- export IMAGE="${DOCKER_ORG}/${DOCKER_REPO}"
- |
docker build \
-t ${IMAGE}:${VERSION} \
--build-arg version=$VERSION \
.
- docker run --rm ${IMAGE}:${VERSION} tests/test.sh
- echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_USER}" --password-stdin
- docker tag ${IMAGE}:${VERSION} ${IMAGE}:latest
- docker push ${IMAGE}:${VERSION}
- docker push ${IMAGE}:latest
##### BASE #####
FROM rocker/r-ver:4.2.1
##### BUILD ARGUMENTS #####
ARG version=unknown
##### METADATA #####
MAINTAINER zavolab-biozentrum@unibas.ch
LABEL base.image="rocker/r-ver:4.2.1"
LABEL version="1"
LABEL software="ascii_alignment_pileup.R"
LABEL software.version="1.0.1"
LABEL software.version=$version
LABEL software.description="Generates an ASCII-style pileup of read alignments in one or more BAM files against one or more regions specified in a BED file"
LABEL software.website="https://git.scicore.unibas.ch/zavolan_group/tools/ascii-alignment-pileup"
LABEL software.documentation="https://git.scicore.unibas.ch/zavolan_group/tools/ascii-alignment-pileup"
......@@ -64,4 +67,3 @@ WORKDIR ${WORKDIR}
RUN chown -R ${USER}:${GROUP} ${WORKDIR} \
&& chmod 700 ${WORKDIR}
USER ${USER}
......@@ -29,10 +29,11 @@ against one or more regions specified in a BED file.\n"
author <- "Author: Alexander Kanitz"
affiliation <- "Affiliation: Biozentrum, University of Basel"
email <- "Email: alexander.kanitz@alumni.ethz.ch"
version <- "Version: 1.0.2"
version <- "1.1.0"
version_formatted <- paste("Version:", version, sep=" ")
requirements <- c("optparse", "rtracklayer", "GenomicAlignments", "tools")
requirements_txt <- paste("Requires:", paste(requirements, collapse=", "), sep=" ")
msg <- paste(description, author, affiliation, email, version, requirements_txt, sep="\n")
msg <- paste(description, author, affiliation, email, version_formatted, requirements_txt, sep="\n")
notes <- "Notes:
- For the input queries, consider the `--maximum-region-width` parameter, which
is provided for safety. While it is possible to increase it, wide regions may
......
6b5a66981bd83329219002897be393a6 test.test-mir.min.1.pileup.tab
#!/usr/bin/env bash
# Tear down test environment
cleanup () {
rc=$?
rm "test.test-mir.min.1.pileup.tab"
cd $user_dir
echo "Exit status: $rc"
}
trap cleanup EXIT
# Set up test environment
set -eo pipefail # ensures that script exits at first command that exits with non-zero status
set -u # ensures that script exits when unset variables are used
set -x # facilitates debugging by printing out executed commands
user_dir=$PWD
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
cd $script_dir
ascii_alignment_pileup.R \
--verbose \
--reference="test_files/test.fa.gz" \
--annotations="test_files/test.gff" \
--output-directory="$PWD" \
"test_files/test.bed" \
"test_files/test.bam"
# Check md5 sum of output file
md5sum --check "expected_output.md5"
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment