.gitlab-ci.yml 1.25 KB
Newer Older
1
2
stages:
  - build
3
  - stock
4
5
6
7
8
9
10
11
  - deploy

Gen-VM:
  tags:
    - "virtualbox"
    - "ansible"
    - "vagrant"
  stage: build
Jean-Francois Rey's avatar
Jean-Francois Rey committed
12
  script:
Jean-Francois Rey's avatar
up ci    
Jean-Francois Rey committed
13
14
    - vboxmanage controlvm windows10R4 poweroff || true
    - vboxmanage unregistervm --delete windows10R4 || true
Jean-Francois Rey's avatar
Jean-Francois Rey committed
15
    - vagrant box update
Jean-Francois Rey's avatar
Jean-Francois Rey committed
16
17
    #- vagrant up > vagrantup.log
    - vagrant up
Jean-Francois Rey's avatar
Jean-Francois Rey committed
18
    - vagrant snapshot save bootR4
Jean-Francois Rey's avatar
up CI    
Jean-Francois Rey committed
19
  after_script:
20
    - vagrant halt
Jean-Francois Rey's avatar
Jean-Francois Rey committed
21
22
23
  artifacts:
    paths:
      - vagrantup.log
24

25
26
27
28
29
30
31
32
33
34
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/
Jean-Francois Rey's avatar
Jean-Francois Rey committed
35
    - rm windows10R4_virtualbox.box || true
36

37
38
39
40
41
42
Deploy-VM:
  tags:
    - "virtualbox"
    - "ansible"
    - "vagrant"
  stage: deploy
43
  when: manual
Jean-Francois Rey's avatar
Jean-Francois Rey committed
44
  script:
Jean-Francois Rey's avatar
up ci    
Jean-Francois Rey committed
45
46
47
48
    - vboxmanage controlvm win10R4 poweroff || true
    - vboxmanage unregistervm --delete win10R4 || true
    - vboxmanage modifyvm windows10R4 --name win10R4 || true
    - sudo vboxmanage unregistervm win10R4 || true
Jean-Francois Rey's avatar
Jean-Francois Rey committed
49
    - sudo vboxmanage registervm "/home/VirtualBox VMs/win10R4/win10R4.vbox"