Commit 09f4479d authored by Christian's avatar Christian 🐧
Browse files

fix ci logic

parent c7cf59f0
Loading
Loading
Loading
Loading
+16 −13
Original line number Diff line number Diff line

stages:
  - build
  - testbuild
  - deploy
  - cleanup

variables:
  imageversion: "2.2"
@@ -12,28 +11,32 @@ variables:

before_script:
    - "docker login -u gitlab-ci-token -p $CI_JOB_TOKEN ${CI_REGISTRY}"
    - 'curl "${rootfsurl}" > rootfs.tar.gz'
    - 'echo "${rootfssha256sum} rootfs.tar.gz" | sha256sum -c &> /dev/null || exit 98'
    - 'chmod a+x build.sh'

after_script:
    - 'rm -f rootfs.tar.gz'
    - "docker logout ${CI_REGISTRY}"
    - "docker image prune -a -f"

build:
  stage: build
testbuild:
  stage: testbuild
  except:
    - tags
    - triggers
  tags: 
    - docker
  script:
    - 'curl "${rootfsurl}" > rootfs.tar.gz'
    - 'echo "${rootfssha256sum} rootfs.tar.gz" | sha256sum -c &> /dev/null || exit 98'
    - 'chmod a+x build.sh'
    - "./build.sh --rootfstarfile rootfs.tar.gz --imagename ${pushtag}"
    - 'rm -f rootfs.tar.gz'

deploy:
  stage: deploy
  only:
    - tags
    - triggers
  tags: 
    - docker
  script:
    - "./build.sh --rootfstarfile rootfs.tar.gz --imagename ${pushtag}"
    - "docker push ${pushtag}"

cleanup:
  stage: cleanup
  script:
    - "docker image prune -a -f"