Browse Source

chore: Remove all refs to GNC

pull/8/head
Michaël Costa 3 months ago
parent
commit
f10d287b96
8 changed files with 10 additions and 205 deletions
  1. +3
    -4
      .drone.yml
  2. +0
    -26
      CHANGELOG.md
  3. +1
    -2
      CONTRIBUTING.md
  4. +0
    -134
      Jenkinsfile
  5. +4
    -12
      Makefile
  6. +1
    -13
      README.md
  7. +1
    -5
      setup.cfg
  8. +0
    -9
      sonar-project.properties

+ 3
- 4
.drone.yml View File

@ -32,10 +32,9 @@ steps:
- bump2version patch
- VERSION=$(grep ^current_version ./.bumpversion.cfg | cut -d\ -f3);
- SCORE=$(pylint ./scrippy_api/* --exit-zero --confidence=HIGH -f parseable | tail -n2 | head -n1 | cut -d\ -f7)
- auto-changelog -v $${VERSION} --starting-commit 4000c1eafb9191d9567ee9030675dffe4770b303 -d 'Fichier généré automatiquement par auto-changelog' --diff-url https://git.mcos.nc/scrippy/scrippy-api/compare/{previous}...{current}
- sed -i "1c \![version](https://img.shields.io/static/v1?label=version&color=informational&message=$${VERSION}) ![pylint](https://img.shields.io/static/v1?label=pylint&color=informational&message=$${SCORE}) $${badge_url}" README.md
- git add setup.cfg .bumpversion.cfg CHANGELOG.md README.md
- git commit -m 'Increment version and update changelog [CI SKIP]'
- git add setup.cfg .bumpversion.cfg README.md
- git commit -m 'Increment version [CI SKIP]'
- pypirc -s local -u $${pip_user} -p $${pip_password} -r https://pip.mcos.nc
- python3 setup.py sdist bdist_wheel register -r local upload -r local
- git push origin
@ -73,6 +72,6 @@ services:
---
kind: signature
hmac: 81f030a0414eba1ebba0c04dc3b0b7da4bb891ac33b180fe84d8877f8bf8fd77
hmac: 1efb85d8fbd17451006dd7295c2e82951767d0791f0032248c018d7cebeacd73
...

+ 0
- 26
CHANGELOG.md View File

@ -1,26 +0,0 @@
# Changelog
Fichier généré automatiquement par auto-changelog
## 1.1.67 (2021-02-05)
#### Fixes
* remove unecessary dependency
* dev target needs setuptools dependency
* requests version for RHEL 6
* sonar-project.properties
#### Docs
* Typo
#### Others
* clean Makefile
* clean contributing.md
* clean setup.cfg
* Better distclean
* First Jenkins build
* New test URL
* first drone build
* Basic test
* Typo

+ 1
- 2
CONTRIBUTING.md View File

@ -24,9 +24,8 @@ pip install -e .
# Conventions
## Commits
Le projet utilise la lib https://github.com/Michael-F-Bryan/auto-changelog pour générer automatiquement le fichier `CHANGELOG.md`
Pour cela, les messages de commits doivent respecter la spécification [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
Les messages de commits doivent respecter la spécification [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
```
<type>[(optional scope)]: <description>


+ 0
- 134
Jenkinsfile View File

@ -1,134 +0,0 @@
@Library('infra-shared-libs@master') _
currentBuild.result = "SUCCESS"
pipeline {
agent {
label 'master'
}
options {
gitLabConnection('gitlab-infra')
//On ne garde que les 10 derniers builds
buildDiscarder(logRotator(numToKeepStr: '10'))
gitlabBuilds(builds: [
"Init",
"Build and test",
"Code Quality",
"Packaging"
])
}
stages {
stage('Init') {
steps {
gitlabCommitStatus(name: 'Init'){
script{
// On renseigne la description du build
fillBuildDescription()
// Récupération de la branch et si merge request, merge des branches
checkoutAndMerge()
}
}
}
}
stage('Build and test') {
steps{
gitlabCommitStatus(name: 'Build and test') {
script{
withPythonEnv('python3') {
sh "pip install --upgrade pip"
sh "python -m pip install .[dev]"
sh "python3 -m pytest --cov=scrippy_api --junitxml=./junit_report.xml"
}
}
}
}
}
stage('Code Quality') {
steps{
gitlabCommitStatus(name: 'Code Quality') {
script{
if (!isMergeRequest()) {
sonar()
}
}
}
}
}
stage('Packaging') {
steps{
gitlabCommitStatus(name: 'Packaging') {
script{
if (!isMergeRequest()) {
withCredentials([usernamePassword(
credentialsId: 'jenkins-infra-artifactory',
usernameVariable: 'ARTIFACTORY_USER',
passwordVariable: 'ARTIFACTORY_PASS')]) {
withPythonEnv('python3') {
sh "bump2version patch"
String version = getAppVersion()
sh "auto-changelog -v ${version} --issue-url https://gitlab-infra.ref.gnc/scrippy/scrippy-api/issues/{id} --starting-commit 547393a0eb6ecee1acd0b8d9a63374235d17a6ae -d 'Fichier généré automatiquement par auto-changelog' --diff-url https://gitlab-infra.ref.gnc/scrippy/scrippy-api/compare/{previous}...{current}"
sh "git add setup.cfg .bumpversion.cfg CHANGELOG.md"
sh "git commit -m 'increment version and update changelog [ci-skip]'"
sh "git tag ${version}"
sh "python3 setup.py sdist bdist_wheel"
sh "python3 -m twine upload -u ${ARTIFACTORY_USER} -p ${ARTIFACTORY_PASS} --repository-url http://artifactory.ref.gnc/artifactory/api/pypi/pypi-local dist/*"
}
}
sshagent (credentials: ['jenkins-sshkey']) {
sh "git push origin"
sh "git push --tags"
}
}
}
}
}
}
}
post {
always {
junit allowEmptyResults: true, testResults: 'junit_report.xml'
commentMergeRequest()
cleanWs()
}
success{
updateGitlabCommitStatus name: 'jenkins', state: 'success'
}
failure {
updateGitlabCommitStatus name: 'jenkins', state: 'failed'
sendMail()
}
}
}
def sonar() {
withSonarQubeEnv('Sonar [PROD]') {
def scannerHome = tool('sonar scanner default');
sh scannerHome+'/sonar-scanner' +
' -Dsonar.projectVersion=' + getAppVersion() +
' -Dsonar.projectKey=' + getAppName()
}
}
def getAppName() {
return sh(returnStdout: true, script: 'python3 setup.py --name').trim()
}
def getAppVersion() {
return sh(returnStdout: true, script: 'python3 setup.py --version').trim()
}
def commentMergeRequest(){
if (isMergeRequest()) {
def resultIcon = currentBuild.result == 'SUCCESS' ? ':white_check_mark:' : ':skull_crossbones:'
addGitLabMRComment "$resultIcon Jenkins Build $currentBuild.result\n\nResults available at: [Jenkins [$env.JOB_NAME#$env.BUILD_NUMBER]]($env.BUILD_URL)"
}
}

+ 4
- 12
Makefile View File

@ -1,7 +1,7 @@
VERSION=$(shell python3 ./setup.py --version)
.RECIPEPREFIX +=
.PHONY: install uninstall all distclean test bumpversion autochangelog tag dist push release
.PHONY: install uninstall all distclean test bumpversion tag dist push release
all: | uninstall install distclean
@ -28,18 +28,10 @@ test:
bumpversion:
bump2version patch
autochangelog:
VERSION=$(shell python3 ./setup.py --version)
auto-changelog -v "${VERSION}" \
--issue-url https://git.mcos.nc/scrippy/scrippy-api/issues/{id} \
--starting-commit 84d2fe411f1e89f85c05bb1f5de569630e6b9cdc \
-d 'Fichier généré automatiquement par auto-changelog' \
--diff-url https://git.mcos.nc/scrippy/scrippy-api/src/tag/{current}
tag:
VERSION=$(shell python3 ./setup.py --version)
git add setup.cfg .bumpversion.cfg CHANGELOG.md
git commit -m 'increment version and update changelog [ci-skip]'
git add setup.cfg .bumpversion.cfg
git commit -m 'increment version [ci-skip]'
git tag "${VERSION}"
dist:
@ -49,4 +41,4 @@ push:
git push origin
git push --tags
release: | distclean test bumpversion autochangelog tag dist push
release: | distclean test bumpversion tag dist push

+ 1
- 13
README.md View File

@ -26,7 +26,7 @@ Le code qu'il contient ainsi que l'ensemble des configurations et documentations
### Manuelle
```bash
git clone ssh://git@gitlab-infra.ref.gnc:22022/scrippy/scrippy-api.git
git clone https://git.mcos.nc/scrippy/scrippy-api.git
cd scrippy-api.git
sudo python3 -m pip install -r requirements.txt
make install
@ -34,18 +34,6 @@ make install
### Avec `pip`
La version de `pip` utilisée doit être la plus à jour possible et `pip` doit être configuré pour utiliser un serveur de dépôt ayant une copie du module `scrippy-api`.
#### Configuration de `pip`
- **/etc/pip.conf**
```ini
[global]
index-url = http://artifactory.ref.gnc/artifactory/api/pypi/pypi-repos/simple
trusted-host = artifactory.ref.gnc
```
#### Installation du module
```bash
sudo pip3 install scrippy-api
```


+ 1
- 5
setup.cfg View File

@ -4,7 +4,7 @@ classifiers =
Programming Language :: Python :: 3
License :: WTFPL
Operating System :: POSIX :: Linux
url = https://gitlab-infra.ref.gnc/scrippy/scrippy-api
url = https://git.mcos.nc/scrippy/scrippy-api
description = "Fonctions d'utilisation d'API ReST."
name = scrippy-api
long_description = file: README.md
@ -36,7 +36,6 @@ dev =
pytest==5.2.1
pytest-cov>=2.8.1
bump2version==0.5.11
auto-changelog==0.5.1
setuptools>=39.2.0
pypirc-chappers>=1.0.8
pylint>=2.4.4
@ -47,6 +46,3 @@ exclude = .git,__pycache__,build,dist
max-line-length = 160
use-flake8-tabs = true
tab-width = 2
[easy_install]
index-url = http://artifactory.ref.gnc/artifactory/api/pypi/pypi-repos/simple/

+ 0
- 9
sonar-project.properties View File

@ -1,9 +0,0 @@
sonar.projectName=scrippy-api
sonar.gitlab.project_id=scrippy/scrippy-api
sonar.gitlab.url=https://gitlab-infra.ref.gnc
sonar.sources=.
sonar.sourceEncoding=UTF-8
sonar.exclusions=tests/**,**/*.pyc
sonar.tests=tests

Loading…
Cancel
Save