diff --git a/.circleci/README.md b/.circleci/README.md new file mode 100644 index 0000000000..3a22b2e915 --- /dev/null +++ b/.circleci/README.md @@ -0,0 +1,80 @@ +PyNE-CI Documentation +===================== + + +PyNE Circle-CI use CIrcle_CI version 2.1 and is composed of 4 main sections: +`executors`, `commands`, `jobs` and `workflow`. + +Executors +--------- +The `executors` define aliases to the environment to run the different jobs. In our case these are +different docker images containing different combinations of the optional +dependencies of PyNE (`MOAB`, `pyMOAB`, `DAGMC`) in one of the two supported +Python versions (Python 2.7 or Python 3.6). + + +Commands +--------- +The `commands` section provides the definitions of macro commands with arguments to be used +in the different jobs. + +`news_check`: checks the presence of a new news file in the news folder + + +`save_container`: saves the status of a container to be reloaded in an +other job. + + - `arguments`: + - `build` (string): build configuration parameters, used to identify a + build configuration + + +`pull_container`: pulls a previously saved (using the `save_container` command) status of container. + + - `arguments`: + - `build` (string): build configuration parameters (has to match the build + argument used to save the container) + + +`checkout_build`: checks out PyNE branch to be tested, builds it and saves it +using the `save_container` command. + + - `arguments`: + - `build` (string): used to identify a configuration + - `flags` (string): flags to be use when building PyNE + + +`run_test`: pulls a previous container using `pull_container` command, then runs the PyNE +nosetests using the provided `flag`. + + - `arguments`: + - `build` (string): used to identify a configuration + - `flags` (string): flags to be use when running the PyNE nosetests + + +`website_build_push`: pull the Python 2.7 build with all the PyNE optional +depedencies `python2_dagmc_pymoab` saved image (using `pull_container` command), +build the website, and push it to the `pyne.github.com` repo. + + - `arguments`: + - `push_option` (string: `test` or `root`): + - `test` option will push the newly built website to `website_preview` + branch of the repo allowing reviews. + - `root` option will push the website on the `master` branch of the repo, + deploying a new version of the website in `pyne.io` + + +Jobs +---- +The `jobs` section defines all the different jobs used in the different +workflows. For each built configuration two jobs have been defined, one to build +PyNE, and one to run the `nosetests`. In addition to the build and test +jobs, two additional jobs have been created to build and push the website, one +to the `website_test` branch of the `pyne.github.com` repo, and one to the +`master` branch. + + +Workflow +-------- +The `workflow` section defines independent workflow triggers the different +jobs (with triggers). diff --git a/.circleci/config.yml b/.circleci/config.yml index 136f2bb563..442b0b1555 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -104,6 +104,30 @@ commands: cd ~/repo/tests ./travis-run-tests.sh << parameters.flags >> + # Build and push PyNE website + website_build_push: + description: "build PyNE website and push it either on the test branch (default) or on the deployed branch" + parameters: + push_option: + type: string + default: "test" + steps: + - pull_container: + build: "python2_dagmc_pymoab" + - add_ssh_keys: + fingerprints: + - $PYNE_KEY_FINGERPRINT + - run: + command: | + git config --global user.email "pyne-dev@googlegroups.com" + git config --global user.name "report errors on github.com/PyNE/PyNE" + - run: + name: Build PyNE website + command: | + cd docs/ + make html + make push-<< parameters.push_option >> + # Jobs part: # Define the different job that will be ran this separate building form # testing for each configuration allowing to get more information out of the CI @@ -227,6 +251,25 @@ jobs: flags: "python2" build: "python2_dagmc_pymoab" +# Website +# Build and push the website + build_push_website_test: + executor: + name: py2_dagmc_pymoab + working_directory: ~/repo + steps: + - website_build_push: + push_option: "test" + + build_push_website_deploy: + executor: + name: py2_dagmc_pymoab + working_directory: ~/repo + steps: + - website_build_push: + push_option: "root" + + # Workflow part: # This part defines the list of the jobs that will be ran and in which sequence. # The goal was to avoid running advanced configuration if PyNE does not work @@ -279,3 +322,26 @@ workflows: - py2_dagmc_pymoab_test: requires: - py2_dagmc_pymoab_build + + + # Build/Push test website + - build_push_website_test: + requires: + - py2_dagmc_pymoab_test + - py3_dagmc_pymoab_test + filters: + branches: + only: + - develop + + + # only done on tags + - build_push_website_deploy: + requires: + - py2_dagmc_pymoab_test + - py3_dagmc_pymoab_test + filters: + branches: + ignore: /.*/ + tags: + only: /.*/ diff --git a/docs/Makefile b/docs/Makefile index 21208e5b58..2972938422 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -123,6 +123,17 @@ push-release: git commit -am "Pushed $(RELEASE) docs at $$(date)" && \ git push +push-test: + cd $(BUILDDIR) && \ + test -d $(DOCREPONAME) || git clone $(DOCREPOURL) $(DOCREPONAME) && \ + cd $(DOCREPONAME) && \ + git checkout -b website_preview origin/website_preview && \ + rm -rf * && \ + cp -r ../html/* . && \ + git add . && \ + git commit -am "Pushed root-level docs at $$(date) on ci_testing branch" && \ + git push + # USE THIS ONE!!! push-root: cd $(BUILDDIR) && \ diff --git a/news/website_ci_deploy.rst b/news/website_ci_deploy.rst new file mode 100644 index 0000000000..45bbe84da2 --- /dev/null +++ b/news/website_ci_deploy.rst @@ -0,0 +1,14 @@ +**Added:** None +- automatic deployement of a updated version of the website on tags +- automatic creation of a new version of the website (not deployed) for + verication purposes in `pyne.github.com/website_preview` + +**Changed:** None + +**Deprecated:** None + +**Removed:** None + +**Fixed:** None + +**Security:** None