Commit b09e9bb0 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

CI stuff

parent 94b19039
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ build:
    - make package
  artifacts:
    paths:
      - package/
      - dist/

upload:
  stage: upload
@@ -29,9 +29,8 @@ upload:
  rules:
    - if: $CI_COMMIT_TAG
  script:
    - MAX_VERSION=$(cat package/VERSION)
    - ASSET="max-v2_${MAX_VERSION}.zip"
    - PACKAGE_REGISTRY_URL=${CI_API_V4_URL}/projects/${REGISTRY_PROJECT_ID}/packages/generic/max-v2/${MAX_VERSION}
    - ASSET="max-v2_${CI_COMMIT_TAG}.zip"
    - PACKAGE_REGISTRY_URL=${CI_API_V4_URL}/projects/${REGISTRY_PROJECT_ID}/packages/generic/max-v2/${CI_COMMIT_TAG}
    - echo "will upload "$ASSET" at "${PACKAGE_REGISTRY_URL}/${ASSET}
    - |
      curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file package/${ASSET} "${PACKAGE_REGISTRY_URL}/${ASSET}"
@@ -42,9 +41,8 @@ release:
  rules:
    - if: $CI_COMMIT_TAG
  script:
    - MAX_VERSION=$(cat package/VERSION)
    - ASSET="max-v2_${MAX_VERSION}.zip"
    - PACKAGE_REGISTRY_URL=${CI_API_V4_URL}/projects/${REGISTRY_PROJECT_ID}/packages/generic/max-v2/${MAX_VERSION}
    - ASSET="max-v2_${CI_COMMIT_TAG}.zip"
    - PACKAGE_REGISTRY_URL=${CI_API_V4_URL}/projects/${REGISTRY_PROJECT_ID}/packages/generic/max-v2/${CI_COMMIT_TAG}
    - |
      release-cli create --name "MaX-v2_$CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \
        --description "Pour installer MaX V2, télécharger l'archive packagée (rubrique *other*) ci-dessus." \
+6 −4
Original line number Diff line number Diff line
@@ -41,8 +41,8 @@ tests: ## Exécution des tests unitaires


package: install ## Construction d'une version distribuable de MaX
	@if [ -d package ]; then\
		rm -rf package;\
	@if [ -d dist ]; then\
		rm -rf dist;\
	fi
# génération d'un fichier VERSION
	@if [ ! -f VERSION ]; then\
@@ -50,7 +50,6 @@ package: install ## Construction d'une version distribuable de MaX
		git rev-parse HEAD > VERSION ;\
	fi
	@mkdir -p package
	@cp VERSION package/
	@cp -rL .max package/.max
	@rm -rf package/.max/basex/webapp/max/bundles/*
# nettoyage du BaseX copié : suppression fichiers liées aux bundles, des données
@@ -63,8 +62,11 @@ package: install ## Construction d'une version distribuable de MaX
	@cp -r $(SRC_DIR)/scripts/max.sh package/
	$(eval version=`cat VERSION`)
	@zip -r max-v2_$(version).zip package
	@echo 'Package créé : max-v2_'$(version)'.zip'
	@mkdir dist
	@mv max-v2_$(version).zip dist/
	@echo 'Package créé : dist/max-v2_'$(version)'.zip'
	@rm VERSION
	@rm -rf package
.PHONY: package

run: ## Lancement de MaX
+4 −4
Original line number Diff line number Diff line
@@ -88,13 +88,13 @@ feed(){ # add XML sources to 'max' db

freeze(){ # freeze corpus as HTML pages
  run &
	if [ -d dist ]; then
		rm -rf dist
	if [ -d site ]; then
		rm -rf site
	fi
	sleep 5
	echo -n "Statification..."
	wget -P dist -nH --mirror --page-requisites --html-extension --convert-links 'http://127.0.0.1:1234/fr/pages/index.html'
	echo -n "Version statique construite dans le répertoire dist/"
	wget -P site -nH --mirror --page-requisites --html-extension --convert-links 'http://127.0.0.1:1234/fr/pages/index.html'
	echo -n "Version statique construite dans le répertoire site/"
}

add(){ # Add bundle