.gitlab-ci.yml 1.27 KB
Newer Older
Jean-Francois Rey's avatar
Jean-Francois Rey committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
stages:
  - build
  - stock
  - deploy

Gen-VM:
  tags:
    - "virtualbox"
    - "ansible"
    - "vagrant"
  stage: build
  script:
    - vboxmanage controlvm MacOSCR4 poweroff || true
    - vboxmanage unregistervm --delete MacOSCR4 || 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:
    - time vagrant package --base MacOSCR4 --output MacOS_Catalina_R4_virtualbox.box
    - time 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 MacOS_Catalina_R4_virtualbox.box s3://gaev-stock/
    - rm MacOS_Catalina_R4_virtualbox.box || true

Deploy-VM:
  tags:
    - "virtualbox"
    - "ansible"
    - "vagrant"
  stage: deploy
  when: manual
  script:
    - vboxmanage controlvm MACOSCR4 poweroff || true
    - vboxmanage unregistervm --delete MACOSCR4 || true
    - vboxmanage modifyvm MacOSCR4 --name MACOSCR4
    - sudo vboxmanage unregistervm MACOSCR4 || true
    - sudo vboxmanage registervm "/home/gitlab-runner/VirtualBox VMs/MACOSCR4/MACOSCR4.vbox"