Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Реализована авторизация в registry от cr.yandex (#26) #27

Open
wants to merge 4 commits into
base: feature/first-bit
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
build_info.txt
.DS_Store
dive.log
key.json

# Configuration file for HASP LM
nethasp.ini
distr/
distr/
1 change: 1 addition & 0 deletions .onec.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export EDT_VERSION=2021.2.7
export DOCKER_USERNAME=jugatsu
export DOCKER_LOGIN=login
export DOCKER_PASSWORD=password
export DOCKER_CR_YANDEX=false

export DOCKER_SYSTEM_PRUNE=false
export NO_CACHE=false
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ copy .onec.env.bat.example env.bat
* ONEC_USERNAME - учётная запись на http://releases.1c.ru
* ONEC_PASSWORD - пароль для учётной записи на http://releases.1c.ru
* ONEC_VERSION - версия платформы 1С:Преприятия 8.3, которая будет в образе
* DOCKER_USERNAME - учётная запись на [Docker Hub](https://hub.docker.com)
* DOCKER_USERNAME - учётная запись на [Docker Hub](https://hub.docker.com), или адрес локального registry, или адрес registry на cr.yandex
* DOCKER_CR_YANDEX - признак, что используется registry на cr.yandex
* DOCKER_LOGIN - имя пользователя registry
* DOCKER_PASSWORD - пароль пользователя registry, а в случае с cr.yandex - имя файла с данными авторизации [по json ключу](https://cloud.yandex.ru/docs/container-registry/operations/authentication#sa-json).

Затем экспортируйте все необходимые переменные:

Expand Down
9 changes: 8 additions & 1 deletion build-base-jenkins-agent.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#!/bin/bash
set -e

docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD $DOCKER_USERNAME
if [ $DOCKER_CR_YANDEX = 'true' ] ; then
cat $DOCKER_PASSWORD | docker login \
--username $DOCKER_LOGIN \
--password-stdin \
cr.yandex
else
docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD $DOCKER_USERNAME
fi

if [ $DOCKER_SYSTEM_PRUNE = 'true' ] ; then
docker system prune -af
Expand Down
9 changes: 8 additions & 1 deletion build-crs.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#!/bin/bash
set -e

docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD $DOCKER_USERNAME
if [ $DOCKER_CR_YANDEX = 'true' ] ; then
cat $DOCKER_PASSWORD | docker login \
--username $DOCKER_LOGIN \
--password-stdin \
cr.yandex
else
docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD $DOCKER_USERNAME
fi

if [ $DOCKER_SYSTEM_PRUNE = 'true' ] ; then
docker system prune -af
Expand Down
9 changes: 8 additions & 1 deletion build-edt-agent.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#!/bin/bash
set -e

docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD $DOCKER_USERNAME
if [ $DOCKER_CR_YANDEX = 'true' ] ; then
cat $DOCKER_PASSWORD | docker login \
--username $DOCKER_LOGIN \
--password-stdin \
cr.yandex
else
docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD $DOCKER_USERNAME
fi

if [ $DOCKER_SYSTEM_PRUNE = 'true' ] ; then
docker system prune -af
Expand Down
9 changes: 8 additions & 1 deletion build-oscript-agent.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#!/bin/bash
set -e

docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD $DOCKER_USERNAME
if [ $DOCKER_CR_YANDEX = 'true' ] ; then
cat $DOCKER_PASSWORD | docker login \
--username $DOCKER_LOGIN \
--password-stdin \
cr.yandex
else
docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD $DOCKER_USERNAME
fi

if [ $DOCKER_SYSTEM_PRUNE = 'true' ] ; then
docker system prune -af
Expand Down