Преглед на файлове

CICD for packages and containers

pull/531/head
Guillaume Vincent преди 4 години
родител
ревизия
a73daf6a1e
променени са 6 файла, в които са добавени 69 реда и са изтрити 46 реда
  1. +29
    -0
      .github/workflows/deploy-containers.yml
  2. +29
    -0
      .github/workflows/deploy-packages.yml
  3. +0
    -43
      .github/workflows/deploy.yml
  4. +9
    -0
      .github/workflows/test.yml
  5. +1
    -2
      containers/deploy
  6. +1
    -1
      packages/deploy

+ 29
- 0
.github/workflows/deploy-containers.yml Целия файл

@@ -0,0 +1,29 @@
name: deploy-containers

on:
push:
paths:
- 'containers/**'

jobs:
test-containers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: test containers
run: |
cd container
./test

deploy-containers:
runs-on: ubuntu-latest
needs: test-containers
steps:
- uses: actions/checkout@v2
- name: deploy containers
run: |
cd containers
./deploy
env:
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}

+ 29
- 0
.github/workflows/deploy-packages.yml Целия файл

@@ -0,0 +1,29 @@
name: deploy-packages

on:
push:
paths:
- 'packages/**'

jobs:
test-packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: test packages
run: |
yarn install
yarn test

deploy-packages:
runs-on: ubuntu-latest
needs: test-packages
steps:
- uses: actions/checkout@v2
- name: deploy packages
run: |
cd packages
./deploy
continue-on-error: true
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

+ 0
- 43
.github/workflows/deploy.yml Целия файл

@@ -1,43 +0,0 @@
name: deploy

on:
push:
tags:
- '*'

jobs:
deploy-containers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: deploy containers
run: |
./bin/deploy_containers
env:
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}

deploy-node-modules:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: deploy node modules
run: |
./bin/deploy_node_modules
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

deploy-web-extensions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: deploy web extensions
run: |
./bin/deploy_web_extensions
env:
EXTENSION_ID: ${{ secrets.EXTENSION_ID }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }}
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }}

+ 9
- 0
.github/workflows/test.yml Целия файл

@@ -51,3 +51,12 @@ jobs:
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python manage.py test

test-containers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: test containers
run: |
cd container
./test

bin/deploy_containers → containers/deploy Целия файл

@@ -16,12 +16,10 @@ set -o pipefail
set -o nounset

function build_and_push_container {
pushd containers
container=$1
docker build --tag lesspass/${container} ./${container}
docker tag lesspass/${container} quay.io/lesspass/${container}
docker push quay.io/lesspass/${container}
popd
}

function build_and_push_containers {
@@ -29,6 +27,7 @@ function build_and_push_containers {
build_and_push_container webserver
build_and_push_container backend
build_and_push_container frontend
build_and_push_container blog
}

build_and_push_containers

bin/deploy_node_modules → packages/deploy Целия файл

@@ -21,7 +21,7 @@ function push_packages_on_npm {
projects="lesspass lesspass-crypto lesspass-entropy lesspass-fingerprint lesspass-pure lesspass-render-password"
for project in ${projects}
do
pushd packages/${project}
pushd ${project}
yarn publish --non-interactive
popd
done

Зареждане…
Отказ
Запис