Browse Source

chore: Remove all refs to GNC

pull/13/head
Michaël Costa 3 months ago
parent
commit
a0712add3a
8 changed files with 10 additions and 204 deletions
  1. +3
    -4
      .drone.yml
  2. +0
    -25
      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_template/* --exit-zero --confidence=HIGH -f parseable | tail -n2 | head -n1 | cut -d\ -f7)
- auto-changelog -v $${VERSION} --starting-commit 40e9d87f6cbf9684e82b89a592e1c6d65f3ac625 -d 'Fichier généré automatiquement par auto-changelog' --diff-url https://git.mcos.nc/scrippy/scrippy-template/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
@ -65,6 +64,6 @@ steps:
- pull_request
---
kind: signature
hmac: db8273ed706e8c9f61d4e1451b61500fd1e97e737105f4183afeeda49e066708
hmac: c7f171ebe4f1a5e93d361b02ad2638e1893afdc56949f8cff2f75ad9898365dd
...

+ 0
- 25
CHANGELOG.md View File

@ -1,25 +0,0 @@
# Changelog
Fichier généré automatiquement par auto-changelog
## 1.1.77 (2021-02-06)
#### Fixes
* Skipped Drone pipeline when release
#### Others
* build ordering in CI/CD [#13](https://git.mcos.nc/scrippy/scrippy-template/issues/13)
* build ordering in CI/CD [#13](https://git.mcos.nc/scrippy/scrippy-template/issues/13)
* build ordering in CI/CD [#12](https://git.mcos.nc/scrippy/scrippy-template/issues/12)
* build ordering in CI/CD [#11](https://git.mcos.nc/scrippy/scrippy-template/issues/11)
* build ordering in CI/CD [#10](https://git.mcos.nc/scrippy/scrippy-template/issues/10)
* build ordering in CI/CD [#9](https://git.mcos.nc/scrippy/scrippy-template/issues/9)
* build ordering in CI/CD [#8](https://git.mcos.nc/scrippy/scrippy-template/issues/8)
* build ordering in CI/CD [#6](https://git.mcos.nc/scrippy/scrippy-template/issues/6)
* build ordering in CI/CD [#5](https://git.mcos.nc/scrippy/scrippy-template/issues/5)
* build ordering in CI/CD [#4](https://git.mcos.nc/scrippy/scrippy-template/issues/4)
* build ordering in CI/CD [#2](https://git.mcos.nc/scrippy/scrippy-template/issues/2)
* build ordering in CI/CD [#2](https://git.mcos.nc/scrippy/scrippy-template/issues/2)
* build ordering in CI/CD
* Drone user 1

+ 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_template --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-template/issues/{id} --starting-commit f568fdc9a451043ce2c4e4955dd5194ea1d33607 -d 'Fichier généré automatiquement par auto-changelog' --diff-url https://gitlab-infra.ref.gnc/scrippy/scrippy-template/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-template/issues/{id} \
--starting-commit 84d2fe411f1e89f85c05bb1f5de569630e6b9cdc \
-d 'Fichier généré automatiquement par auto-changelog' \
--diff-url https://git.mcos.nc/scrippy/scrippy-db/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

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


+ 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-template
url = https://git.mcos.nc/scrippy/scrippy-template
description = "Gestion simplifiée des fichiers modèles"
name = scrippy-template
long_description = file: README.md
@ -34,7 +34,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
@ -45,6 +44,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-template
sonar.gitlab.project_id=scrippy/scrippy-template
sonar.gitlab.url=https://gitlab-infra.ref.gnc
sonar.sources=.
sonar.sourceEncoding=UTF-8
sonar.exclusions=tests/**,**/*.pyc
sonar.tests=tests

Loading…
Cancel
Save