add kaniko, add env in Dockerfile
Some checks failed
continuous-integration/drone/push Build encountered an error
Some checks failed
continuous-integration/drone/push Build encountered an error
This commit is contained in:
33
.drone.yml
33
.drone.yml
@@ -3,30 +3,28 @@ type: docker
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: build image
|
||||
image: docker:24
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run/docker.sock
|
||||
- name: build and push with kaniko
|
||||
image: gcr.io/kaniko-project/executor:latest
|
||||
environment:
|
||||
DOCKER_USERNAME:
|
||||
from_secret: DOCKER_USERNAME
|
||||
CICD_TOKEN:
|
||||
from_secret: CICD_TOKEN
|
||||
commands:
|
||||
- docker login git.iamninja.ru -u "$DOCKER_USERNAME" -p "$CICD_TOKEN"
|
||||
- docker build -t git.iamninja.ru/iamninja/pomodoro_tg_bot:latest .
|
||||
|
||||
- name: push image
|
||||
image: plugins/docker
|
||||
settings:
|
||||
registry: git.iamninja.ru
|
||||
repo: git.iamninja.ru/iamninja/pomodoro_tg_bot
|
||||
tags: latest
|
||||
username:
|
||||
from_secret: DOCKER_USERNAME
|
||||
password:
|
||||
from_secret: CICD_TOKEN
|
||||
commands:
|
||||
- |
|
||||
/kaniko/executor \
|
||||
--dockerfile=Dockerfile \
|
||||
--context=. \
|
||||
--destination=git.iamninja.ru/iamninja/pomodoro_tg_bot:latest \
|
||||
--cache=true \
|
||||
--cache-repo=git.iamninja.ru/iamninja/pomodoro_tg_bot/cache \
|
||||
--skip-tls-verify \
|
||||
--username "$DOCKER_USERNAME" \
|
||||
--password "$CICD_TOKEN"
|
||||
|
||||
- name: deploy to server
|
||||
image: appleboy/drone-ssh
|
||||
@@ -55,8 +53,3 @@ steps:
|
||||
- docker login git.iamninja.ru -u "$DOCKER_USERNAME" -p "$CICD_TOKEN"
|
||||
- docker compose pull
|
||||
- docker compose up -d
|
||||
|
||||
volumes:
|
||||
- name: dockersock
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
|
||||
Reference in New Issue
Block a user