diff --git a/.github/workflows/build_gitpod.yml b/.github/workflows/build_gitpod.yml new file mode 100644 index 000000000..da926a310 --- /dev/null +++ b/.github/workflows/build_gitpod.yml @@ -0,0 +1,44 @@ +name: nf-core gitpod build and push +# Builds the docker image for gitpod and pushes it to DockerHub + +on: + push: + branches: + - 'master' + paths: + - 'nf_core/gitpod/gitpod.Dockerfile' + - '.github/workflows/build_gitpod.yml' + +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + # Only run for the nf-core repo, for releases and merged PRs + if: ${{ github.repository == 'nf-core/tools' }} + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASS }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v3 + with: + images: nfcore/gitpod + tags: | + type=semver,pattern={{version}} + type=raw,value=latest + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: . + file: nf_core/gitpod/gitpod.Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 000000000..86ed68060 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,17 @@ +image: nfcore/gitpod:latest +tasks: + - name: install current state of nf-core/tools + command: | + python -m pip install --upgrade -r requirements-dev.txt -e . +vscode: + extensions: # based on nf-core.nf-core-extensionpack + - codezombiech.gitignore # Language support for .gitignore files + # - cssho.vscode-svgviewer # SVG viewer + - davidanson.vscode-markdownlint # Markdown/CommonMark linting and style checking for Visual Studio Code + - eamodio.gitlens # Quickly glimpse into whom, why, and when a line or code block was changed + - EditorConfig.EditorConfig # override user/workspace settings with settings found in .editorconfig files + - Gruntfuggly.todo-tree # Display TODO and FIXME in a tree view in the activity bar + - mechatroner.rainbow-csv # Highlight columns in csv files in different colors + # - nextflow.nextflow # Nextflow syntax highlighting + - oderwat.indent-rainbow # Highlight indentation level + - streetsidesoftware.code-spell-checker # Spelling checker for source code diff --git a/CHANGELOG.md b/CHANGELOG.md index 93ec4fa4a..841aacdeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,11 @@ * Remove base `Dockerfile` used for DSL1 pipeline container builds * Run tests with Python 3.10 * [#1363](https://github.com/nf-core/tools/pull/1363) Fix tools CI workflow nextflow versions. +* [#1384](https://github.com/nf-core/tools/pull/1384) Adds Gitpod environment and Dockerfile. + * Adds conda, Nextflow, nf-core, pytest-workflow, mamba, and pip to base Gitpod Docker image. + * Adds GH action to build and push Gitpod Docker image. + * Adds Gitpod environment to template. + * Adds Gitpod environment to tools with auto build of nf-core tool. ### Modules diff --git a/nf_core/gitpod/gitpod.Dockerfile b/nf_core/gitpod/gitpod.Dockerfile new file mode 100644 index 000000000..d5a17cd33 --- /dev/null +++ b/nf_core/gitpod/gitpod.Dockerfile @@ -0,0 +1,23 @@ +FROM gitpod/workspace-full + +USER root + +# Install Conda +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ + bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda && \ + rm Miniconda3-latest-Linux-x86_64.sh + +ENV PATH="/opt/conda/bin:$PATH" + +RUN chown -R gitpod:gitpod /opt/conda + +USER gitpod + +# Install nextflow, nf-core, Mamba, and pytest-workflow +RUN conda update -n base -c defaults conda && \ + conda install nextflow nf-core pytest-workflow mamba pip -n base -c conda-forge -c bioconda && \ + nextflow self-update && \ + conda config --add channels defaults && \ + conda config --add channels bioconda && \ + conda config --add channels conda-forge && \ + conda clean --all -f -y diff --git a/nf_core/pipeline-template/.gitpod.yml b/nf_core/pipeline-template/.gitpod.yml new file mode 100644 index 000000000..b7d4cee18 --- /dev/null +++ b/nf_core/pipeline-template/.gitpod.yml @@ -0,0 +1,14 @@ +image: nfcore/gitpod:latest + +vscode: + extensions: # based on nf-core.nf-core-extensionpack + - codezombiech.gitignore # Language support for .gitignore files + # - cssho.vscode-svgviewer # SVG viewer + - davidanson.vscode-markdownlint # Markdown/CommonMark linting and style checking for Visual Studio Code + - eamodio.gitlens # Quickly glimpse into whom, why, and when a line or code block was changed + - EditorConfig.EditorConfig # override user/workspace settings with settings found in .editorconfig files + - Gruntfuggly.todo-tree # Display TODO and FIXME in a tree view in the activity bar + - mechatroner.rainbow-csv # Highlight columns in csv files in different colors + # - nextflow.nextflow # Nextflow syntax highlighting + - oderwat.indent-rainbow # Highlight indentation level + - streetsidesoftware.code-spell-checker # Spelling checker for source code