Skip to content

Commit

Permalink
Merge pull request #10 from daystram/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
daystram authored Jul 19, 2021
2 parents a95d189 + f8f3783 commit e508df6
Show file tree
Hide file tree
Showing 7 changed files with 248 additions and 2 deletions.
File renamed without changes.
77 changes: 77 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Nightly

on:
workflow_dispatch:

jobs:
image:
name: Publish Image
environment: Development
runs-on: Ubuntu-20.04
env:
APPLICATION: cut
strategy:
matrix:
service: [be, fe]
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set Development Version
run: echo "RELEASE_VERSION=v0.0.0-development" >> $GITHUB_ENV
- name: Provide Env File
run: |
echo "${{ secrets.FE_ENV_FILE }}" > ${{ env.APPLICATION }}-${{ matrix.service }}/.env.production
echo "VUE_APP_VERSION=${{ env.RELEASE_VERSION }}" >> ${{ env.APPLICATION }}-${{ matrix.service }}/.env.production
- name: Build and Push Image
uses: docker/build-push-action@v2
with:
context: ${{ env.APPLICATION }}-${{ matrix.service }}
platforms: linux/amd64
tags: daystram/${{ env.APPLICATION }}:${{ matrix.service }}-dev
push: true
chart:
name: Publish Helm Chart
environment: Development
runs-on: Ubuntu-20.04
container: daystram/k8s-tools:latest
needs: [image]
env:
APPLICATION: cut
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set Development Version
run: echo "RELEASE_VERSION=v0.0.0-development" >> $GITHUB_ENV
- name: Initialize Git Credentials
run: |
git config --global user.name "${{ secrets.BOTDAYSTRAM_NAME }}"
git config --global user.email "${{ secrets.BOTDAYSTRAM_EMAIL }}"
mkdir -p /root/.ssh && echo "${{ secrets.BOTDAYSTRAM_KEY_FILE }}" > /root/.ssh/id_rsa.github && chmod 600 /root/.ssh/id_rsa.github
cat >> /etc/ssh/ssh_config <<EOF
Host github.com
HostName github.com
IdentityFile /root/.ssh/id_rsa.github
IdentitiesOnly yes
StrictHostKeyChecking no
EOF
echo "${{ secrets.KUBECONFIG_FILE }}" > $KUBECONFIG && chmod 700 $KUBECONFIG
- name: Build and Deploy Chart
run: |
eval `ssh-agent -s`
git clone ssh://git@github.com/daystram/helm-charts.git
cp -r .daystram helm-charts/docs/
cd helm-charts/docs/
curl -sfL https://charts.daystram.com/build.sh | sh -s - ${{ env.APPLICATION }} ${{ env.RELEASE_VERSION }}
rm -rf .daystram/
git add .
git commit -m "feat: added chart for ${{ env.APPLICATION }}@${{ env.RELEASE_VERSION }}"
git push
67 changes: 67 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build
on: push
jobs:
build-be:
name: Build cut-be
runs-on: Ubuntu-20.04
defaults:
run:
working-directory: cut-be
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --all-features --manifest-path cut-be/Cargo.toml
- name: Archive Artifacts
uses: actions/upload-artifact@v2
with:
name: build-be
path: |
cut-be/target/release/cut-be
lint-fe:
name: Lint cut-fe
runs-on: ubuntu-latest
defaults:
run:
working-directory: cut-fe
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2.1.5
with:
node-version: 12.x
- name: Install Dependencies
run: yarn install
- name: eslint
run: yarn lint
build-fe:
name: Build cut-fe
runs-on: Ubuntu-20.04
defaults:
run:
working-directory: cut-fe
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2.1.5
with:
node-version: 12.x
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Build
run: yarn build
- name: Archive Artifacts
uses: actions/upload-artifact@v2
with:
name: build-fe
path: |
cut-fe/dist/
81 changes: 81 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Release

on:
push:
tags:
- v*.*.*

jobs:
image:
name: Publish Image
environment: Production
runs-on: Ubuntu-20.04
env:
APPLICATION: cut
strategy:
matrix:
service: [be, fe]
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Get Release Version
run: echo "RELEASE_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Provide Env File
run: |
echo "${{ secrets.FE_ENV_FILE }}" > ${{ env.APPLICATION }}-${{ matrix.service }}/.env.production
echo "VUE_APP_VERSION=${{ env.RELEASE_VERSION }}" >> ${{ env.APPLICATION }}-${{ matrix.service }}/.env.production
- name: Build and Push Image
uses: docker/build-push-action@v2
with:
context: ${{ env.APPLICATION }}-${{ matrix.service }}
platforms: linux/amd64
tags: |
daystram/${{ env.APPLICATION }}:${{ matrix.service }}
daystram/${{ env.APPLICATION }}:${{ matrix.service }}-${{ env.RELEASE_VERSION }}
push: true
chart:
name: Publish Helm Chart
environment: Production
runs-on: Ubuntu-20.04
container: daystram/k8s-tools:latest
needs: [image]
env:
APPLICATION: cut
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Get Release Version
run: echo "RELEASE_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Initialize Git Credentials
run: |
git config --global user.name "${{ secrets.BOTDAYSTRAM_NAME }}"
git config --global user.email "${{ secrets.BOTDAYSTRAM_EMAIL }}"
mkdir -p /root/.ssh && echo "${{ secrets.BOTDAYSTRAM_KEY_FILE }}" > /root/.ssh/id_rsa.github && chmod 600 /root/.ssh/id_rsa.github
cat >> /etc/ssh/ssh_config <<EOF
Host github.com
HostName github.com
IdentityFile /root/.ssh/id_rsa.github
IdentitiesOnly yes
StrictHostKeyChecking no
EOF
echo "${{ secrets.KUBECONFIG_FILE }}" > $KUBECONFIG && chmod 700 $KUBECONFIG
- name: Build and Deploy Chart
run: |
eval `ssh-agent -s`
git clone ssh://git@github.com/daystram/helm-charts.git
cp -r .daystram helm-charts/docs/
cd helm-charts/docs/
curl -sfL https://charts.daystram.com/build.sh | sh -s - ${{ env.APPLICATION }} ${{ env.RELEASE_VERSION }}
rm -rf .daystram/
git add .
git commit -m "feat: added chart for ${{ env.APPLICATION }}@${{ env.RELEASE_VERSION }}"
git push
3 changes: 3 additions & 0 deletions cut-fe/.env.development
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
NODE_ENV=development
BASE_URL=localhost
VUE_APP_TITLE=Cut
VUE_APP_CLIENT_ID=client_id_from_ratify_be
VUE_APP_OAUTH_ISSUER=https://ratify.daystram.com
VUE_APP_VERSION=v0.0.0-development
13 changes: 12 additions & 1 deletion cut-fe/src/styles/App.sass
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ html
.app-subtitle
max-width: 480px

.app-version
position: absolute
bottom: 32px
margin: 0 auto
left: 0
right: 0
text-align: center
user-select: none
-moz-user-select: none
-webkit-user-select: none

a.text-link
color: white !important
background-color: transparent
Expand Down Expand Up @@ -38,4 +49,4 @@ code
.danger-border
border: var(--v-error-base) !important
border-style: solid !important
border-width: 1px !important
border-width: 1px !important
9 changes: 8 additions & 1 deletion cut-fe/src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
</v-btn>
</v-row>
</v-col>
<div class="app-version text-overline text--disabled">
{{ appVersion || "" }}
</div>
</v-container>
</template>

Expand All @@ -47,7 +50,11 @@ import { authManager } from "@/auth";
export default Vue.extend({
components: { Logo },
data() {
return {
appVersion: process.env.VUE_APP_VERSION
};
},
computed: {
isAuthenticated() {
return authManager.isAuthenticated();
Expand Down

0 comments on commit e508df6

Please sign in to comment.