Skip to content

Instantly share code, notes, and snippets.

@dotob
Created September 4, 2019 13:51
Show Gist options
  • Select an option

  • Save dotob/2405dab957f6c3e288eabb1911edcaf2 to your computer and use it in GitHub Desktop.

Select an option

Save dotob/2405dab957f6c3e288eabb1911edcaf2 to your computer and use it in GitHub Desktop.

Revisions

  1. dotob created this gist Sep 4, 2019.
    103 changes: 103 additions & 0 deletions yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,103 @@
    # this job builds the project and its dependencies
    r4c:
    stage: build
    image: node:8
    # only:
    # changes:
    # - r4c/**/*
    # - types/**/*
    script:
    - yarn run writeVersions
    - cd types
    - yarn --cache-folder ../.yarn-cache
    - cd -
    - cd base
    - yarn --cache-folder ../.yarn-cache
    - cd -
    - cd common-ui
    - yarn --cache-folder ../.yarn-cache
    - cd -
    - cd r4c
    - yarn --cache-folder ../.yarn-cache
    - yarn build
    - cd doc
    - node md2html.js
    - cp help.html ../dist
    - mkdir ../dist/screens
    - cp screens/* ../dist/screens
    - cd -
    artifacts:
    expire_in: 1 week
    paths:
    - r4c/dist/
    cache:
    paths:
    - .yarn-cache/

    # deploy template
    .deploy_r4c_template:
    stage: deploy
    image: node:8
    dependencies:
    - r4c
    before_script:
    - cd r4c
    - yarn --cache-folder ../.yarn-cache
    cache:
    policy: pull
    paths:
    - .yarn-cache/

    # this jobs deploys the app on branches to a temp url
    r4c2test:
    extends: .deploy_r4c_template
    environment:
    name: r4c_test
    script:
    - yarn deploytest
    when: manual
    except:
    - master

    # this job deploys the app manually to staging on any branch but master
    r4c2staging_manual:
    extends: .deploy_r4c_template
    environment:
    name: r4c_staging
    url: https://r4c-staging.rose.dental
    script:
    - yarn deploystaging
    when: manual
    except:
    - master

    # this job deploys the app automatically to staging on the master branch
    r4c2staging:
    extends: .deploy_r4c_template
    environment:
    name: r4c_staging
    url: https://r4c-staging.rose.dental
    script:
    - yarn deploystaging
    only:
    - master

    r4c2prod:
    extends: .deploy_r4c_template
    environment:
    name: r4c_prod
    url: https://r4c.rose.dental
    script:
    - yarn deployprod
    when: manual
    only:
    - master

    r4c2demo:
    extends: .deploy_r4c_template
    environment:
    name: r4c_demo
    url: https://r4c-demo.rose.dental
    script:
    - yarn deploydemo
    when: manual