Commit 79259b3f authored by Joel Collins's avatar Joel Collins
Browse files

Revert "Remove CI file from frame branch"

This reverts commit dac3632c
parent e91b9bf3
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
openflexure_microscope/api/static/** filter=lfs diff=lfs merge=lfs -text
+73 −0
Original line number Diff line number Diff line
stages:
  - build
  - deploy


# Cache modules in between jobs
cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
  - node_modules/


# Electron app build
build:
  stage: build
  image: nikolaik/python-nodejs:python3.7-nodejs14

  variables:
    GIT_SUBMODULE_STRATEGY: recursive

  before_script:
    - git submodule sync --recursive
    - git submodule update --init --recursive
    - curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python

  script:
    # Install server
    - $HOME/.poetry/bin/poetry install
    # Run static build script
    - $HOME/.poetry/bin/poetry run build_static
    # Build distribution archive
    - mkdir -p dist
    - tar -c --exclude-vcs --exclude-from .tarignore -vzf dist/openflexure-microscope-server-${CI_COMMIT_REF_NAME}.tar.gz .

  artifacts:
    name: "dist"
    expire_in: 1 week
    paths:
      - "./dist/*"

  only:
    - merge_requests
    - tags
    - web


# Deploy to builds.openflexure.org
deploy:
  stage: deploy
  dependencies:
    - build
  image: ubuntu:latest
  
  before_script:
    - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
    - eval $(ssh-agent -s)
    - ssh-add <(echo "$SSH_PRIVATE_KEY_BATH_OPENFLEXURE_BASE64" | base64 --decode)
    - mkdir -p ~/.ssh
    - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
    
  script:
    # Install rsync if not already installed
    - 'which rsync || ( apt-get update -y && apt-get install rsync -y )'
    
    # Upload the builds folder to openflexure-microscope builds 
    - rsync -hrvz -e ssh dist/ ci-user@openflexure.bath.ac.uk:/var/www/build/openflexure-microscope-server
    
    # Run update-latest.py on the build server
    - ssh -t ci-user@openflexure.bath.ac.uk "/var/www/build/update-latest.py"
    
  only:
    - tags
    - web

.gitmodules

0 → 100644
+4 −0
Original line number Diff line number Diff line
[submodule "openflexure_microscope/api/static"]
	path = openflexure_microscope/api/static
	url = https://gitlab.com/openflexure/openflexure-microscope-jsclient.git
	branch = frame

.tarignore

0 → 100644
+80 −0
Original line number Diff line number Diff line
Distribution archive rules
node_modules
.gitlab-ci.yml
./dist
!openflexure_microscope/api/static/dist
.tarignore

# Pyenv files
.python-version
.venv*
.env*

# Byte-compiled / optimized / DLL files
__pycache__
*.py[cod]

# C extensions
*.so

# Distribution / packaging
.Pytho
env/
build
develop-eggs
downloads
eggs
lib
lib64
parts
sdist
var
*.egg-info
.installed.cfg
*.egg
pip-wheel-metadata

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov
.tox
.coverage
.cache
nosetests.xml
coverage.xml

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build

# PyBuilder
target

#Big-o files
capture
record
*.data

#IDE files
.vscode
.idea
activate

# UML diagrams
classes.png
packages.png
+9 −0
Original line number Diff line number Diff line
@@ -9,6 +9,15 @@ This includes basic installation instructions suitable for most users.
Full developer documentation can be found on [**ReadTheDocs**](https://openflexure-microscope-software.readthedocs.io/en/stable/). 
This includes installing the server in a mode better suited for active development.

## Installation
* `git clone --recurse-submodules https://gitlab.com/openflexure/openflexure-microscope-server.git`
* `poetry install`
* `poetry run build_static`

### Distributing
* `mkdir -p dist`
* `tar -c --exclude-vcs --exclude-from .tarignore -vzf dist/openflexure-microscope-server.tar.gz .`

## Build-system
As of 1.0.0b0, we're using [Poetry](https://github.com/sdispater/poetry) to manage dependencies, build, and distribute the package. All package information and dependencies are found in `pyproject.toml`, in line with [PEP 518](https://www.python.org/dev/peps/pep-0518/). If you're developing this package, make use of `poetry.lock` to ensure you're using the latest locked dependency list.

Loading