-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
212 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 1.4.0 | ||
|
||
* Добавлен новый метод `ЭтоРепозиторий` (@realMaxA) | ||
|
||
## 1.3.0 | ||
|
||
* Добавлен новый метод `Извлечь` (@dmpas) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
|
||
pipeline { | ||
agent none | ||
options { | ||
buildDiscarder(logRotator(numToKeepStr: '7')) | ||
skipDefaultCheckout() | ||
} | ||
|
||
stages { | ||
stage('Тестирование кода пакета WIN') { | ||
|
||
agent { label 'windows' } | ||
|
||
steps { | ||
checkout scm | ||
|
||
script { | ||
if( fileExists ('tasks/test.os') ){ | ||
bat 'chcp 65001 > nul && oscript tasks/test.os' | ||
junit 'junit-*.xml' | ||
} | ||
else | ||
echo 'no testing task' | ||
} | ||
|
||
} | ||
|
||
} | ||
|
||
stage('Тестирование кода пакета LINUX') { | ||
|
||
agent { label 'master' } | ||
|
||
steps { | ||
echo 'under development' | ||
} | ||
|
||
} | ||
|
||
stage('Сборка пакета') { | ||
|
||
agent { label 'windows' } | ||
|
||
steps { | ||
checkout scm | ||
|
||
bat 'erase /Q *.ospx' | ||
bat 'chcp 65001 > nul && call opm build .' | ||
|
||
stash includes: '*.ospx', name: 'package' | ||
archiveArtifacts '*.ospx' | ||
} | ||
|
||
} | ||
|
||
stage('Публикация в хабе') { | ||
when { | ||
branch 'master' | ||
} | ||
agent { label 'master' } | ||
steps { | ||
sh 'rm -f *.ospx' | ||
unstash 'package' | ||
|
||
sh ''' | ||
artifact=`ls -1 *.ospx` | ||
basename=`echo $artifact | sed -r 's/(.+)-.*(.ospx)/\\1/'` | ||
cp $artifact $basename.ospx | ||
sudo rsync -rv *.ospx /var/www/hub.oscript.io/download/$basename/ | ||
'''.stripIndent() | ||
} | ||
} | ||
|
||
stage('Публикация в нестабильном хабе') { | ||
when { | ||
branch 'develop' | ||
} | ||
agent { label 'master' } | ||
steps { | ||
sh 'rm -f *.ospx' | ||
unstash 'package' | ||
|
||
sh ''' | ||
artifact=`ls -1 *.ospx` | ||
basename=`echo $artifact | sed -r 's/(.+)-.*(.ospx)/\\1/'` | ||
cp $artifact $basename.ospx | ||
sudo rsync -rv *.ospx /var/www/hub.oscript.io/dev-channel/$basename/ | ||
'''.stripIndent() | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Реализация шагов BDD-фич/сценариев c помощью фреймворка https://github.com/artbear/1bdd | ||
|
||
#Использовать tempfiles | ||
|
||
Перем БДД; //контекст фреймворка 1bdd | ||
|
||
// Метод выдает список шагов, реализованных в данном файле-шагов | ||
Функция ПолучитьСписокШагов(КонтекстФреймворкаBDD) Экспорт | ||
БДД = КонтекстФреймворкаBDD; | ||
|
||
ВсеШаги = Новый Массив; | ||
|
||
ВсеШаги.Добавить("ЯПроверяюСуществованиеРепозиторияВоВременномКаталогеИРезультатСохраняюВКонтекст"); | ||
ВсеШаги.Добавить("РезультатРавен"); | ||
|
||
Возврат ВсеШаги; | ||
КонецФункции | ||
|
||
// Реализация шагов | ||
|
||
// Процедура выполняется перед запуском каждого сценария | ||
Процедура ПередЗапускомСценария(Знач Узел) Экспорт | ||
|
||
КонецПроцедуры | ||
|
||
// Процедура выполняется после завершения каждого сценария | ||
Процедура ПослеЗапускаСценария(Знач Узел) Экспорт | ||
|
||
КонецПроцедуры | ||
|
||
//Я проверяю существование репозитория во временном каталоге и результат сохраняю в контекст | ||
Процедура ЯПроверяюСуществованиеРепозиторияВоВременномКаталогеИРезультатСохраняюВКонтекст() Экспорт | ||
ГитРепозиторий = БДД.ПолучитьИзКонтекста("ГитРепозиторий"); | ||
ВременныйКаталог = БДД.ПолучитьИзКонтекста("ВременныйКаталог"); | ||
ГитРепозиторий.УстановитьРабочийКаталог(ВременныйКаталог); | ||
Результат = ГитРепозиторий.ЭтоРепозиторий(); | ||
БДД.СохранитьВКонтекст("Результат", Результат); | ||
КонецПроцедуры | ||
|
||
//Результат равен | ||
Процедура РезультатРавен(Знач ОжидаемыйРезультат) Экспорт | ||
Результат = БДД.ПолучитьИзКонтекста("Результат"); | ||
Ожидаем.Что(Результат).Равно(Булево(ОжидаемыйРезультат)); | ||
КонецПроцедуры | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# language: ru | ||
|
||
Функциональность: Проверка существования репозитория в рабочем каталоге | ||
|
||
Как разработчик Я хочу иметь возможность проверить, что рабочий каталог является git-репозиторием | ||
Чтобы не писать такую проверку для каждого скрипта | ||
|
||
Сценарий: Проверка каталога с репозиторием | ||
Когда Я создаю новый объект ГитРепозиторий | ||
И Я создаю временный каталог и сохраняю его в контекст | ||
И Я инициализирую репозиторий во временном каталоге | ||
И Я проверяю существование репозитория во временном каталоге и результат сохраняю в контекст | ||
Тогда Результат равен "Истина" | ||
|
||
Сценарий: Проверка каталога без репозитория | ||
Когда Я создаю новый объект ГитРепозиторий | ||
И Я создаю временный каталог и сохраняю его в контекст | ||
И Я проверяю существование репозитория во временном каталоге и результат сохраняю в контекст | ||
Тогда Результат равен "Ложь" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters