2023-04-15 14:42:13 -05:00
|
|
|
---
|
|
|
|
kind: secret
|
|
|
|
name: docker_username
|
|
|
|
get:
|
|
|
|
path: docker
|
|
|
|
name: username
|
|
|
|
---
|
|
|
|
kind: secret
|
|
|
|
name: docker_password
|
|
|
|
get:
|
|
|
|
path: docker
|
|
|
|
name: password
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: kubernetes
|
|
|
|
name: publish
|
|
|
|
steps:
|
|
|
|
- name: build
|
|
|
|
image: docker.io/jcollie/nixos-runner:latest
|
|
|
|
pull: always
|
|
|
|
commands:
|
2023-08-17 13:42:58 -05:00
|
|
|
# - set
|
2023-08-17 13:38:15 -05:00
|
|
|
- nix run .#login
|
2023-08-17 13:42:58 -05:00
|
|
|
- echo -n "$${PLUGIN_PASSWORD}" | podman login --username $${PLUGIN_USERNAME} --password-stdin $${PLUGIN_REGISTRY}
|
2023-04-15 14:42:13 -05:00
|
|
|
- nix build .#nixos-runner
|
2023-08-17 12:58:53 -05:00
|
|
|
# - nix run .#push-container -- result
|
2023-08-17 12:46:46 -05:00
|
|
|
- podman load --input result | sed -n -e "s/Loaded image:.\\(.*\\)/\\1/p" > loaded-image
|
|
|
|
- cat loaded-image
|
|
|
|
- podman images
|
2023-08-17 13:27:44 -05:00
|
|
|
- podman tag "$$(<loaded-image)" "$${PLUGIN_REGISTRY}/${PLUGIN_REPOSITORY}:$${DRONE_BUILD_NUMBER}-$${DRONE_COMMIT_SHA:0:8}"
|
|
|
|
- podman tag "$$(<loaded-image)" "$${PLUGIN_REGISTRY}/${PLUGIN_REPOSITORY}:latest"
|
2023-08-17 12:46:46 -05:00
|
|
|
- podman images
|
2023-08-17 13:42:58 -05:00
|
|
|
- podman push "$${PLUGIN_REGISTRY}/$${PLUGIN_REPOSITORY}:$${DRONE_BUILD_NUMBER}-$${DRONE_COMMIT_SHA:0:8}"
|
2023-08-17 13:38:15 -05:00
|
|
|
- podman push "$${PLUGIN_REGISTRY}/$${PLUGIN_REPOSITORY}:latest"
|
2023-08-17 13:27:44 -05:00
|
|
|
- podman logout "$${PLUGIN_REGISTRY}"
|
2023-08-17 13:22:59 -05:00
|
|
|
env:
|
|
|
|
REGISTRY: docker.io
|
|
|
|
REPOSITORY: jcollie/nixos-runner
|
|
|
|
USERNAME:
|
|
|
|
from_secret: docker_username
|
|
|
|
PASSWORD:
|
|
|
|
from_secret: docker_password
|
2023-04-15 14:42:13 -05:00
|
|
|
settings:
|
|
|
|
registry: docker.io
|
|
|
|
repository: jcollie/nixos-runner
|
|
|
|
username:
|
|
|
|
from_secret: docker_username
|
|
|
|
password:
|
|
|
|
from_secret: docker_password
|