Browse Source

chore: Remove all refs to GNC

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

+ 3
- 4
.drone.yml View File

@ -35,10 +35,9 @@ steps:
- bump2version patch
- VERSION=$(grep ^current_version ./.bumpversion.cfg | cut -d\ -f3);
- SCORE=$(pylint ./scrippy_git/* --exit-zero --confidence=HIGH -f parseable | tail -n2 | head -n1 | cut -d\ -f7)
- auto-changelog -v $${VERSION} --starting-commit 69b5accbb8e1e848e6b74c660c6a6d1a773fe1dc -d 'Fichier généré automatiquement par auto-changelog' --diff-url https://git.mcos.nc/scrippy/scrippy-git/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
@ -76,6 +75,6 @@ services:
---
kind: signature
hmac: befd4d20f7638bdc7e246392e734b691c9ee9e36e519ef838724ed5ec256cd8d
hmac: 63ea4b9d22b4a2acc4ff4978a1f78cd73079460561a4a238328b6235d8fa4dcb
...

+ 0
- 15
CHANGELOG.md View File

@ -1,15 +0,0 @@
# Changelog
Fichier généré automatiquement par auto-changelog
## 1.1.64 (2021-02-05)
#### Fixes
* remove unecessary dependency
* dev target needs setuptools dependency
* Removed unecessary reference in setup.cfg
#### Others
* fake test
* first drone build

+ 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_git --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-git/issues/{id} --starting-commit 2062da5ba9a4b09f4f4741d0fbe8f8c9e8d002d5 -d 'Fichier généré automatiquement par auto-changelog' --diff-url https://gitlab-infra.ref.gnc/scrippy/scrippy-git/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-git/issues/{id} \
--starting-commit 69b5accbb8e1e848e6b74c660c6a6d1a773fe1dc \
-d 'Fichier généré automatiquement par auto-changelog' \
--diff-url https://git.mcos.nc/scrippy/scrippy-git/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
- 14
README.md View File

@ -24,7 +24,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-git.git
git clone https://git.mcos.nc/scrippy/scrippy-git.git
cd scrippy-git.git
sudo python3 -m pip install -r requirements.txt
make install
@ -32,19 +32,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-git`.
#### 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-git
```


+ 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-git
url = https://git.mcos.nc/scrippy/scrippy-git
description = "Socle de fonctions utilisées dans les scripts python de gestion d'infrastructure."
name = scrippy-git
long_description = file: README.md
@ -33,7 +33,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
@ -44,6 +43,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-git
sonar.gitlab.project_id=scrippy/scrippy-git
sonar.gitlab.url=https://gitlab-infra.ref.gnc
sonar.sources=.
sonar.sourceEncoding=UTF-8
sonar.exclusions=tests/**,**/*.pyc
sonar.tests=tests

Loading…
Cancel
Save