-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
129 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
name: Pre-release | ||
|
||
on: | ||
# push: | ||
# branches: | ||
# - main | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
create-pre-release: | ||
runs-on: ubuntu-latest | ||
name: Build and push Docker image and create a new GitHub pre-release | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set environment variables | ||
run: | | ||
echo VERSION=$(cat VERSION).$GITHUB_RUN_NUMBER >> $GITHUB_ENV | ||
echo BASE_IMAGE_NAME=$REGISTRY/$(echo ${GITHUB_REPOSITORY,,}) >> $GITHUB_ENV | ||
echo COMMITED_AT=$(git show -s --format=%cI `git rev-parse HEAD`) >> $GITHUB_ENV | ||
echo REVISION=$(git rev-parse --short HEAD) >> $GITHUB_ENV | ||
- name: Collect Docker image metadata | ||
id: meta-app | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.BASE_IMAGE_NAME }}-app-dev | ||
labels: | | ||
org.opencontainers.image.created=${{ env.COMMITED_AT }} | ||
org.opencontainers.image.version=v${{ env.VERSION }} | ||
org.opencontainers.image.maintainer=EBP Schweiz AG | ||
flavor: | | ||
latest=false | ||
tags: | | ||
type=edge | ||
type=semver,pattern=v{{version}},value=${{ env.VERSION }} | ||
- name: Collect Docker image metadata | ||
id: meta-api | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.BASE_IMAGE_NAME }}-api-dev | ||
labels: | | ||
org.opencontainers.image.created=${{ env.COMMITED_AT }} | ||
org.opencontainers.image.version=v${{ env.VERSION }} | ||
org.opencontainers.image.maintainer=EBP Schweiz AG | ||
flavor: | | ||
latest=false | ||
tags: | | ||
type=edge | ||
type=semver,pattern=v{{version}},value=${{ env.VERSION }} | ||
- name: Log in to the GitHub container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image (app) | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./apps/client-asset-sg/docker | ||
push: true | ||
build-args: | | ||
VERSION=${{ env.VERSION }} | ||
REVISION=${{ env.REVISION }} | ||
tags: ${{ steps.meta-app.outputs.tags }} | ||
labels: ${{ steps.meta-app.outputs.labels }} | ||
cache-from: type=registry,ref=${{ env.BASE_IMAGE_NAME }}-app-dev:edge | ||
cache-to: type=inline | ||
|
||
- name: Build and push Docker image (api) | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./apps/server-asset-sg/docker | ||
push: true | ||
build-args: | | ||
VERSION=${{ env.VERSION }} | ||
REVISION=${{ env.REVISION }} | ||
tags: ${{ steps.meta-api.outputs.tags }} | ||
labels: ${{ steps.meta-api.outputs.labels }} | ||
cache-from: type=registry,ref=${{ env.BASE_IMAGE_NAME }}-api-dev:edge | ||
cache-to: type=inline | ||
|
||
# - name: Create GitHub pre-release | ||
# run: | | ||
# gh api \ | ||
# --method POST \ | ||
# --header "Accept: application/vnd.github+json" \ | ||
# /repos/${GITHUB_REPOSITORY}/releases \ | ||
# -f tag_name='v${{ env.VERSION }}' \ | ||
# -f target_commitish='main' \ | ||
# -f name='${{ env.VERSION }}' \ | ||
# -F prerelease=true \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Assets | ||
# SwissGeol Asset | ||
|
||
## Setting up the development environment | ||
|
||
|
@@ -10,25 +10,26 @@ The following components must be installed on the development computer: | |
|
||
The following steps must be carried out once: | ||
|
||
1. Install all necessary modules with `web-asset-swissgeol> npm install`. | ||
2. Decorate the Angular CLI with the Nx CLI `web-asset-swissgeol> npm run postinstall`. | ||
2. Create prisma-client for database-access with `web-asset-swissgeol\apps\server-asset-sg> ng gen-prisma-client`. | ||
3. Set environment variables for dockers in `web-asset-swissgeol\development\.env` | ||
4. Set environment variables for assets-server in `web-asset-swissgeol\apps\server-asset-sg\.env.local` | ||
5. Create local postgis-gotrue docker-image `development\images\db> docker build -t postgis-gotrue .` | ||
6. Creating elastic-search index. Execute in Kibana (`http://localhost:5601/app/dev_tools#/console`) the commands fro file `web-asset-swissgeol\development\init\elasticsearch\index`. --> docker must be started (see below) | ||
1. Clone git repository whit `> git clone https://github.com/geoadmin/web-asset-swissgeol.git`. | ||
2. Install all necessary modules with `web-asset-swissgeol> npm install`. | ||
3. Decorate the Angular CLI with the Nx CLI `web-asset-swissgeol> npm run postinstall`. | ||
4. Create prisma-client for database-access with `web-asset-swissgeol\apps\server-asset-sg> ng gen-prisma-client`. | ||
5. Set environment variables for dockers in `web-asset-swissgeol\development\.env` | ||
6. Set environment variables for assets-server in `web-asset-swissgeol\apps\server-asset-sg\.env.local` | ||
7. Create local postgis-gotrue docker-image `development\images\db> docker build -t postgis-gotrue .` | ||
8. Creating elastic-search index. Execute in Kibana (`http://localhost:5601/app/dev_tools#/console`) the commands fro file `web-asset-swissgeol\development\init\elasticsearch\index`. --> docker must be started (see below) | ||
|
||
### Starting the development environment | ||
|
||
1. Start docker with `web-asset-swissgeol\development>docker-compose up`. | ||
2. Start assets-app with `web-asset-swissgeol>npm run start`. | ||
2. Start asset-swissgeol app with `web-asset-swissgeol>npm run start`. | ||
|
||
**The following services/applications are then available** | ||
|
||
| 🔖 App/Service | 🔗Link | 🧞User | 🔐Password | | ||
| :---------------------- --| :------------------------------------------------| :---------------------| :---------------------- | | ||
| Assets (client) | [localhost:4200](http://localhost:4200/) | `[email protected]` | `adminAssets` | | ||
| Assets REST API (server) | [localhost:3333/api/](http://localhost:3333/api) | n/a | n/a | | ||
| 🔖App/Service | 🔗Link | 🧞User | 🔐Password | | ||
| :-------------------------| :------------------------------------------------| :---------------------| :-----------------------| | ||
| Asset (client) | [localhost:4200](http://localhost:4200/) | `[email protected]` | `adminAssets` | | ||
| Asset REST API (server) | [localhost:3333/api/](http://localhost:3333/api) | n/a | n/a | | ||
| postgresSQL (docker) | localhost:5432 | .env `$DB_USER` |.env `$DB_PASSWORD` | | ||
| Elasticsearch (docker) | [localhost:9200](http://localhost:9200) | n/a | n/a | | ||
| Kibana (docker) | [localhost:5601](http://localhost:5601) | n/a | n/a | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ RUN npx nx build client-asset-sg | |
|
||
# final image build | ||
FROM nginx:mainline-alpine | ||
LABEL maintainer=[email protected] | ||
LABEL maintainer=EBP Schweiz AG | ||
|
||
WORKDIR /usr/share/nginx/html | ||
COPY --from=ui-builder /app/dist/apps/client-asset-sg . | ||
|