#374  Creating Pages like functionality - suggestions needed
Closed
Artur opened 3 years ago

As mentioned in my previous issues, I am trying to replicate Pages like functionality from GitHub and GitLab. Mosty based on 1dev + externally working Nginx or Caddy. So once generated, static files would be copied over via scp to a server hosting static website.

I am now in phase of developing a build for such a website. Here is an example build from GitLab. I need some suggestions on what would be the best way to port it over to 1dev. I mean, I know I can use:

export JEKYLL_ENV=production

and similar to prepare environmnet, but maybe there is a better way to do it in 1dev I am not aware of.

Any suggestions would be very much appreciated.

.pages:
  image: ruby:latest
  variables:
    JEKYLL_ENV: production
    LC_ALL: C.UTF-8
    BUNDLE_PATH: .gem
  before_script:
    - gem install bundler:1.13.6
    - bundle install
  script:
    - bundle exec jekyll build -d public
  only:
    changes:
      - _data/**/*
      - _includes/**/*
      - _pages/**/*
      - _posts/**/*
      - assets/**/*
      - "*.png"
      - _config.yml
      - browserconfig.xml
      - favicon.ico
      - Gemfile
      - Gemfile.lock
      - index.html
      - safari-pinned-tab.svg
      - site.webmanifest
      - staticman.yml

pages:
  extends: .pages
  stage: deploy
  artifacts:
    paths:
      - public
  only:
    refs:
      - master

test:
  extends: .pages
  stage: test
  only:
    refs:
      - merge_requests
Robin Shen commented 3 years ago

Variables can be set directly at start of the shell commands as you've discovered. Content of before_script and script can be merged into a single command step. Various only directives can be achieved with job triggers. There is no extends concept in OneDev. However you can reduce duplication with step template.

Robin Shen changed state to 'Closed' 3 years ago
Previous Value Current Value
Open
Closed
issue 1 of 1
Type
Question
Priority
Normal
Assignee
Issue Votes (0)
Watchers (3)
Reference
onedev/server#374
Please wait...
Page is in error, reload to recover