image: "ruby:2.3" stages: - build - test - staging - production Buid: stage: build script: - bundle install - rake set_git_tag - rake - gem build jekyll-plantuml-url.gemspec artifacts: paths: - ./*.gem expire_in: 1 week tags: - docker test: stage: test script: - gem install jekyll bundler rake - export myGem=`ls *.gem` - export git_version=`git describe --tags --always` - export gem_version="$(sed s/-/\./g <<<$git_version)" - gem install "./$myGem" - mkdir test; cd test - jekyll new test_plantuml - cd test_plantuml - 'echo "gem \"jekyll-plantuml-url\", \"$gem_version\"" >> Gemfile' - 'echo -e "gems:\n - jekyll-plantuml-url\n" >> _config.yml' - 'echo "{% plantuml %}\n[First] - [Second]\n{% endplantuml %}\n" >> index.md' - bundle install - bundle exec jekyll build tags: - docker Release_Staging: stage: staging environment: staging variables: GIT_STRATEGY: none script: - ls -la # - deployctl release .... need to build the website for release, who? deployd ? # or push to private repo artifacts: paths: - ./*.gem except: - branches tags: - docker Release_Production: stage: production environment: production dependencies: - Release_Staging variables: GIT_STRATEGY: none script: - ls -la - mkdir -pv ~/.gem - export Fail=0 - touch ~/.gem/credentials - chmod 0600 ~/.gem/credentials - 'echo -e "---\n:rubygems_api_key: $GEM_API_PUSH\n" >> ~/.gem/credentials' - 'gem push *.gem && echo Success || export Fail=1' - rm -f ~/.gem/credentials - '[ "$Fail" -eq 0 ]' only: - tags except: - branches tags: - docker when: manual