stages: - build - stock - deploy Gen-VM: tags: - "virtualbox" - "ansible" - "vagrant" stage: build script: - vboxmanage controlvm windows10R4 poweroff || true - vboxmanage unregistervm --delete windows10R4 || true - vagrant box update #- vagrant up > vagrantup.log - vagrant up - vagrant snapshot save bootR4 after_script: - vagrant halt artifacts: paths: - vagrantup.log Stock-S3-box: tags: - "virtualbox" - "ansible" - "vagrant" stage: stock when: manual script: - vagrant package --base windows10R4 --output windows10R4_virtualbox.box - s3cmd --access_key=$EC2_ACCESS_KEY --secret_key=$EC2_SECRET_KEY --host=$S3_HOST --host-bucket="%(bucket)s.$S3_HOST" --region="inra-tls" -v put windows10R4_virtualbox.box s3://gaev-stock/ - rm windows10R4_virtualbox.box || true Deploy-VM: tags: - "virtualbox" - "ansible" - "vagrant" stage: deploy when: manual script: - vboxmanage controlvm win10R4 poweroff || true - vboxmanage unregistervm --delete win10R4 || true - vboxmanage modifyvm windows10R4 --name win10R4 || true - sudo vboxmanage unregistervm win10R4 || true - sudo vboxmanage registervm "/home/VirtualBox VMs/win10R4/win10R4.vbox"