This commit is contained in:
parent
462aebdf17
commit
b6a03484e1
22
.drone.yml
22
.drone.yml
@ -39,30 +39,38 @@ steps:
|
|||||||
- |
|
- |
|
||||||
packer validate \
|
packer validate \
|
||||||
-var vm_name=$DRONE_BUILD_NUMBER-${DRONE_COMMIT_SHA:0:10} \
|
-var vm_name=$DRONE_BUILD_NUMBER-${DRONE_COMMIT_SHA:0:10} \
|
||||||
|
-var docker_username=$${DOCKER_USERNAME} \
|
||||||
|
-var docker_password=$${DOCKER_PASSWORD} \
|
||||||
-var repo_username=$${REPO_USERNAME} \
|
-var repo_username=$${REPO_USERNAME} \
|
||||||
-var repo_password=$${REPO_PASSWORD} \
|
-var repo_password=$${REPO_PASSWORD} \
|
||||||
-var vsphere_password=$${VSPHERE_PASSWORD} \
|
|
||||||
-var ssh_password=$${SSH_PASSWORD} \
|
-var ssh_password=$${SSH_PASSWORD} \
|
||||||
|
-var vsphere_password=$${VSPHERE_PASSWORD} \
|
||||||
./packer
|
./packer
|
||||||
- |
|
- |
|
||||||
packer build \
|
packer build \
|
||||||
-on-error=cleanup -timestamp-ui \
|
-on-error=cleanup -timestamp-ui \
|
||||||
-var vm_name=$DRONE_BUILD_NUMBER-${DRONE_COMMIT_SHA:0:10} \
|
-var vm_name=$DRONE_BUILD_NUMBER-${DRONE_COMMIT_SHA:0:10} \
|
||||||
|
-var docker_username=$${DOCKER_USERNAME} \
|
||||||
|
-var docker_password=$${DOCKER_PASSWORD} \
|
||||||
-var repo_username=$${REPO_USERNAME} \
|
-var repo_username=$${REPO_USERNAME} \
|
||||||
-var repo_password=$${REPO_PASSWORD} \
|
-var repo_password=$${REPO_PASSWORD} \
|
||||||
-var vsphere_password=$${VSPHERE_PASSWORD} \
|
|
||||||
-var ssh_password=$${SSH_PASSWORD} \
|
-var ssh_password=$${SSH_PASSWORD} \
|
||||||
|
-var vsphere_password=$${VSPHERE_PASSWORD} \
|
||||||
./packer
|
./packer
|
||||||
environment:
|
environment:
|
||||||
VSPHERE_PASSWORD:
|
DOCKER_USERNAME:
|
||||||
from_secret: vsphere_password
|
from_secret: docker_username
|
||||||
SSH_PASSWORD:
|
DOCKER_PASSWORD:
|
||||||
from_secret: ssh_password
|
from_secret: docker_password
|
||||||
|
# PACKER_LOG: 1
|
||||||
REPO_USERNAME:
|
REPO_USERNAME:
|
||||||
from_secret: repo_username
|
from_secret: repo_username
|
||||||
REPO_PASSWORD:
|
REPO_PASSWORD:
|
||||||
from_secret: repo_password
|
from_secret: repo_password
|
||||||
# PACKER_LOG: 1
|
SSH_PASSWORD:
|
||||||
|
from_secret: ssh_password
|
||||||
|
VSPHERE_PASSWORD:
|
||||||
|
from_secret: vsphere_password
|
||||||
volumes:
|
volumes:
|
||||||
- name: output
|
- name: output
|
||||||
path: /output
|
path: /output
|
||||||
|
@ -37,6 +37,15 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.source }}"
|
label: "{{ item.source }}"
|
||||||
|
|
||||||
|
- name: Log in to container registry
|
||||||
|
ansible.builtin.shell:
|
||||||
|
cmd: >-
|
||||||
|
skopeo login \
|
||||||
|
docker.io \
|
||||||
|
--username={{ docker_username }} \
|
||||||
|
--password={{ docker_password }}
|
||||||
|
no_log: true
|
||||||
|
|
||||||
- name: Pull and store containerimages
|
- name: Pull and store containerimages
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: >-
|
cmd: >-
|
||||||
|
@ -37,6 +37,8 @@ build {
|
|||||||
extra_arguments = [
|
extra_arguments = [
|
||||||
"--extra-vars", "appliancetype=${source.name}",
|
"--extra-vars", "appliancetype=${source.name}",
|
||||||
"--extra-vars", "ansible_ssh_pass=${var.ssh_password}",
|
"--extra-vars", "ansible_ssh_pass=${var.ssh_password}",
|
||||||
|
"--extra-vars", "docker_username=${var.docker_username}",
|
||||||
|
"--extra-vars", "docker_password=${var.docker_password}"
|
||||||
"--extra-vars", "repo_username=${var.repo_username}",
|
"--extra-vars", "repo_username=${var.repo_username}",
|
||||||
"--extra-vars", "repo_password=${var.repo_password}"
|
"--extra-vars", "repo_password=${var.repo_password}"
|
||||||
]
|
]
|
||||||
|
@ -28,3 +28,8 @@ local "iso_authenticatedurl" {
|
|||||||
expression = "https://${var.repo_username}:${var.repo_password}@${var.iso_url}"
|
expression = "https://${var.repo_username}:${var.repo_password}@${var.iso_url}"
|
||||||
sensitive = true
|
sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "docker_username" {}
|
||||||
|
variable "docker_password" {
|
||||||
|
sensitive = true
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user