diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 77b0738..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,167 +0,0 @@ -@Library("rd-apmm-groovy-ci-library@v1.x") _ - -/* - - This file was autogenerated using tooling in commontooling - - DO NOT MANUALLY EDIT THIS FILE - - Instead make necessary changes to Jenkinsfile.json and then - regenerate this file with `make static-files` before checking - the resulting file into git. - - */ - -pipeline { - agent { - label "ubuntu&&apmm-agent" - } - options { - ansiColor('xterm') // Add support for coloured output - buildDiscarder(logRotator(numToKeepStr: '10')) // Discard old builds - } - triggers { - cron(env.BRANCH_NAME == 'main' ? 'H H(0-8) * * *' : '') // Build main some time every morning - } - parameters { - booleanParam(name: "FORCE_DOCSUPLOAD", defaultValue: false, description: "Force API docs upload") - booleanParam(name: "FORCE_ARTIFACTORYUPLOAD", defaultValue: false, description: "Force upload of python wheels to artifactory") - string(name: "PYTHON_VERSION", defaultValue: "3.10", description: "Python version to make available in tox") - string(name: "COMMONTOOLING_BRANCH", defaultValue: "main") - } - environment { - FORGE_CERT = "/etc/pki/tls/private/client_crt_key.pem" - http_proxy = "http://www-cache.rd.bbc.co.uk:8080" - https_proxy = "http://www-cache.rd.bbc.co.uk:8080" - PATH = "$HOME/.pyenv/bin:$PATH" - TOX_WORK_DIR="/tmp/${sh(script: "basename ${WORKSPACE}", , returnStdout: true).trim()}" - WITH_DOCKER = "true" - TOX_ENV = "py${(params.PYTHON_VERSION =~ /(\d+)\.(\d+).*/)[0][1..2].join('')}" - DOCKER_CONFIG = "$WORKSPACE/docker-config/" - } - stages { - stage("Setup Environment") { - steps { - bbcStageSetupEnvironment() - } - post { - always { - bbcGithubNotify(context: "prepcode", status: env.result) - } - } - } - stage ("make check-static-files") { - steps { - withBBCCloudfitPipConfFile { - bbcMake 'check-static-files' - } - } - post { - always { - bbcGithubNotify(context: "check-static-files", status: env.result) - bbcSh "rm -f ${WORKSPACE}/.pip.conf" - } - } - } - stage ("make lint") { - steps { - withBBCCloudfitPipConfFile { - bbcMake 'lint' - } - } - post { - always { - bbcGithubNotify(context: "lint", status: env.result) - bbcSh "rm -f ${WORKSPACE}/.pip.conf" - } - } - } - stage ("make docs") { - steps { - withBBCCloudfitPipConfFile { - bbcMake 'docs' - } - } - post { - always { - bbcGithubNotify(context: "docs", status: env.result) - bbcSh "rm -f ${WORKSPACE}/.pip.conf" - } - } - } - stage ("make test") { - steps { - withBBCCloudfitPipConfFile { - bbcMake 'test' - } - } - post { - always { - bbcGithubNotify(context: "test", status: env.result) - bbcSh "rm -f ${WORKSPACE}/.pip.conf" - } - } - } - stage ("make wheel") { - steps { - withBBCCloudfitPipConfFile { - bbcMake 'wheel' - } - } - post { - always { - bbcGithubNotify(context: "wheel", status: env.result) - bbcSh "rm -f ${WORKSPACE}/.pip.conf" - } - } - } - stage ("Upload package to Artifactory") { - when { - anyOf { - expression { return params.FORCE_ARTIFACTORYUPLOAD } - expression { env.TAG_NAME != null } - expression { - bbcShouldUploadArtifacts(branches: ["main"]) - } - } - } - steps { - withBBCCloudfitPipConfFile { - bbcMake "upload-wheels" - } - } - post { - always { - bbcGithubNotify(context: "upload-wheels", status: env.result) - bbcSh "rm -f ${WORKSPACE}/.pip.conf" - } - } - } - stage ("Upload Docs") { - when { - anyOf { - expression { return params.FORCE_DOCSUPLOAD } - expression { env.TAG_NAME != null } - expression { - bbcShouldUploadArtifacts(branches: ["main"]) - } - } - } - steps { - withBBCStatusRecording(context: 'upload/docs') { - bbcAPMMDocsUpload(sourceFiles: "./docs", recursive: true) - } - } - post { - always { - bbcGithubNotify(context: "upload/docs", status: env.result) - } - } - } - } - post { - always { - bbcSlackNotify(channel: "#apmm-cloudfit") - } - } -} diff --git a/Jenkinsfile.json b/Jenkinsfile.json deleted file mode 100644 index 74f6eac..0000000 --- a/Jenkinsfile.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "docker": true, - "stages": [ - "@setup", - "@make check-static-files", - "@make lint", - "@make docs", - "@make test", - "@make wheel", - "@upload artifactory", - "@upload docs-recursive ./docs" - ] -} \ No newline at end of file diff --git a/README.rst b/README.md similarity index 80% rename from README.rst rename to README.md index 04e711f..773ec1e 100644 --- a/README.rst +++ b/README.md @@ -31,7 +31,7 @@ R&D Artifactory in the ap-python repo. Usage ----- -.. code-block:: python +```python import zipfile import httpio_bbc as httpio @@ -40,10 +40,7 @@ Usage with httpio.open(url) as fp: zf = zipfile.ZipFile(fp) print(zf.namelist()) - -.. _file-like: https://docs.python.org/3/glossary.html#term-file-object - -.. _BufferedIOBase: https://docs.python.org/3/library/io.html#io.BufferedIOBase +``` Development ----------- @@ -62,10 +59,7 @@ the top level of the repository. Continuous Integration ---------------------- -This repository includes a Jenkinsfile which makes use of custom steps defined -in a BBC internal library for use on our own Jenkins instances. As such it will -not be immediately useable outside of a BBC environment, but may still serve as -inspiration and an example of how to implement CI for this package. +This repository includes [GitHub Actions workflows](./.github/workflows/) for CI. The shared workflows are centrally managed and should not be modified. A Makefile is provided at the top-level of the repository to run common tasks. Run `make`` in the top directory of this repository to see what actions are available.