Skip to content

Commit

Permalink
Merge branch 'main' into v7.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima authored Sep 28, 2021
2 parents ffa97e6 + 83fef45 commit 196479f
Show file tree
Hide file tree
Showing 12 changed files with 92 additions and 148 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/docker.yml

This file was deleted.

94 changes: 59 additions & 35 deletions .github/workflows/publish_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,63 @@
name: Publish Containers
on:
push:
branches: [main]
branches:
- main
# Publish semver tags as releases.
tags:
- 'v*.*.*'
jobs:
pipeline:
name: JHipster Registry Docker
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.pull_request.title, '[skip ci]') && !contains(github.event.pull_request.title, '[ci skip]')"
timeout-minutes: 40
steps:
- uses: actions/checkout@v2
- name: 'Setup java'
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 'TOOLS: docker version'
run: docker version
- name: Publish to GitHub Container Registry
run: ./mvnw -ntp verify -DskipTests -Pprod jib:build -Dimage=ghcr.io/${{ github.repository }}:main
- name: 'DOCKER: list image'
run: docker images
- name: 'DOCKER: start container'
run: docker run --name jhipster-registry -p 8761:8761 -d -t -e JHIPSTER_SECURITY_AUTHENTICATION_JWT_BASE64_SECRET='bXktc2VjcmV0LWtleS13aGljaC1zaG91bGQtYmUtY2hhbmdlZC1pbi1wcm9kdWN0aW9uLWFuZC1iZS1iYXNlNjQtZW5jb2RlZAo=' ghcr.io/${{ github.repository }}:main
- name: 'DOCKER: wait 30sec'
run: sleep 30
- name: 'DOCKER list containers'
run: docker container ps -a
- name: 'DOCKER: see logs'
run: docker container logs jhipster-registry
- name: 'DOCKER: curl 8761'
run: curl -v http://localhost:8761
pipeline:
name: JHipster Registry Docker
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.pull_request.title, '[skip ci]') && !contains(github.event.pull_request.title, '[ci skip]')"
timeout-minutes: 40
steps:
- uses: actions/checkout@v2
- name: 'Setup java'
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 'TOOLS: docker version'
run: docker version
- name: Publish to GitHub Container Registry
run: ./mvnw -ntp verify -DskipTests -Pprod jib:build -Dimage=ghcr.io/${{ github.repository }}:main
- name: 'DOCKER: list image'
run: docker images
- name: 'DOCKER: start container'
run: docker run --name jhipster-registry -p 8761:8761 -d -t ghcr.io/${{ github.repository }}:main
- name: 'DOCKER: wait 30sec'
run: sleep 30
- name: 'DOCKER list containers'
run: docker container ps -a
- name: 'DOCKER: see logs'
run: docker container logs jhipster-registry
- name: 'DOCKER: curl 8761'
run: curl -v http://localhost:8761

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: jhipster/jhipster-registry
tags: |
type=semver,pattern=v{{version}}
- name: Login to Docker Registry
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
if: ${{env.DOCKERHUB_USERNAME != '' && startsWith(github.ref, 'refs/tags/v')}}
uses: docker/login-action@v1
id: login-hub
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish to Docker Hub
if: ${{steps.login-hub.outcome == 'success'}}
run: ./mvnw -ntp verify -DskipTests -Pprod jib:build -Dimage=jhipster/jhipster-registry -Djib.to.tags='${{ steps.meta.outputs.version }},latest'
2 changes: 1 addition & 1 deletion .yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"serviceDiscoveryType": "eureka",
"buildTool": "maven",
"enableSocialSignIn": false,
"jwtSecretKey": "c9d37cefc48581919939d587c750ea215020765b",
"jwtSecretKey": "NmQ3NTY1NjhlZGY2NmEzNzUxMjFkZDVmNTA3YjRiNWIxMzM2ZGRiNDNlYjFkMDc2YzdlYTgzYjVkNTNlZGU0NTdiNDg5OTUyNTZjYmNiYjlkMWNjNjE5MTE2NjVhZjM2MmZkYTdiYjRkNGZiMDU5MzhmMDIzYTE4ZjQ3ZTVmMTU=",
"useSass": true,
"enableTranslation": false,
"applicationType": "monolith",
Expand Down
33 changes: 0 additions & 33 deletions Dockerfile

This file was deleted.

24 changes: 0 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -518,27 +518,7 @@
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>${jib-maven-plugin.version}</version>
<dependencies>
<dependency>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-ownership-extension-maven</artifactId>
<version>0.1.0</version>
</dependency>
</dependencies>
<configuration>
<pluginExtensions>
<pluginExtension>
<implementation>com.google.cloud.tools.jib.maven.extension.ownership.JibOwnershipExtension</implementation>
<configuration implementation="com.google.cloud.tools.jib.maven.extension.ownership.Configuration">
<rules>
<rule>
<glob>/target</glob>
<ownership>1000</ownership>
</rule>
</rules>
</configuration>
</pluginExtension>
</pluginExtensions>
<from>
<image>${jib-maven-plugin.image}</image>
<platforms>
Expand Down Expand Up @@ -586,10 +566,6 @@
<file>/entrypoint.sh</file>
<mode>755</mode>
</permission>
<permission>
<file>/target</file>
<mode>775</mode>
</permission>
</permissions>
</extraDirectories>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jhipster:
authentication:
jwt:
# secret key which should be base64 encoded and changed in production
base64-secret: c9d37cefc48581919939d587c750ea215020765b
base64-secret: NmQ3NTY1NjhlZGY2NmEzNzUxMjFkZDVmNTA3YjRiNWIxMzM2ZGRiNDNlYjFkMDc2YzdlYTgzYjVkNTNlZGU0NTdiNDg5OTUyNTZjYmNiYjlkMWNjNjE5MTE2NjVhZjM2MmZkYTdiYjRkNGZiMDU5MzhmMDIzYTE4ZjQ3ZTVmMTU=

eureka:
client:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jhipster:
authentication:
jwt:
# secret key which should be base64 encoded and changed in production
base64-secret: c9d37cefc48581919939d587c750ea215020765b
base64-secret: NmQ3NTY1NjhlZGY2NmEzNzUxMjFkZDVmNTA3YjRiNWIxMzM2ZGRiNDNlYjFkMDc2YzdlYTgzYjVkNTNlZGU0NTdiNDg5OTUyNTZjYmNiYjlkMWNjNjE5MTE2NjVhZjM2MmZkYTdiYjRkNGZiMDU5MzhmMDIzYTE4ZjQ3ZTVmMTU=

eureka:
client:
Expand Down
2 changes: 1 addition & 1 deletion src/main/docker/jhipster-control-center.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ services:
- JHIPSTER_SLEEP=30 # gives time for other services to boot before the application
- SPRING_SECURITY_USER_PASSWORD=admin
# The token should have the same value than the one declared in you Spring configuration under the jhipster.security.authentication.jwt.base64-secret configuration's entry
- JHIPSTER_SECURITY_AUTHENTICATION_JWT_BASE64_SECRET=c9d37cefc48581919939d587c750ea215020765b
- JHIPSTER_SECURITY_AUTHENTICATION_JWT_BASE64_SECRET=NmQ3NTY1NjhlZGY2NmEzNzUxMjFkZDVmNTA3YjRiNWIxMzM2ZGRiNDNlYjFkMDc2YzdlYTgzYjVkNTNlZGU0NTdiNDg5OTUyNTZjYmNiYjlkMWNjNjE5MTE2NjVhZjM2MmZkYTdiYjRkNGZiMDU5MzhmMDIzYTE4ZjQ3ZTVmMTU=
- EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://admin:[email protected]:8761/eureka/
- LOGGING_FILE_NAME=/tmp/jhipster-control-center.log
# If you want to expose these ports outside your dev PC,
Expand Down
25 changes: 25 additions & 0 deletions src/main/docker/jhipster-registry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This configuration is intended for development purpose, it's **your** responsibility to harden it for production
version: '3.8'
services:
jhipster-registry:
image: ghcr.io/jhipster/jhipster-registry:main
volumes:
- ./central-server-config:/central-config
# When run with the "dev" Spring profile, the JHipster Registry will
# read the config from the local filesystem (central-server-config directory)
# When run with the "prod" Spring profile, it will read the configuration from a Git repository
# See https://www.jhipster.tech/jhipster-registry/#spring-cloud-config
environment:
- _JAVA_OPTIONS=-Xmx512m -Xms256m
- SPRING_PROFILES_ACTIVE=dev,api-docs
- SPRING_SECURITY_USER_PASSWORD=admin
- JHIPSTER_REGISTRY_PASSWORD=admin
- SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_TYPE=native
- SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_SEARCH_LOCATIONS=file:./central-config/localhost-config/
# - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_TYPE=git
# - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_URI=https://github.com/jhipster/jhipster-registry/
# - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_SEARCH_PATHS=central-config
# If you want to expose these ports outside your dev PC,
# remove the "127.0.0.1:" prefix
ports:
- 127.0.0.1:8761:8761
5 changes: 3 additions & 2 deletions src/main/docker/jib/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh

echo "The JHipster Registry will start in ${JHIPSTER_SLEEP}s..." && sleep ${JHIPSTER_SLEEP}
exec java ${JAVA_OPTS} -noverify -XX:+AlwaysPreTouch -Djava.security.egd=file:/dev/./urandom -cp /app/resources/:/app/classes/:/app/libs/* "tech.jhipster.registry.JHipsterRegistryApp" "$@"
echo "JHipster Registry will start in ${JHIPSTER_SLEEP}s..." && sleep ${JHIPSTER_SLEEP}
set -x
exec java ${JAVA_OPTS} -noverify -XX:+AlwaysPreTouch -Djava.security.egd=file:/dev/./urandom -cp /app/resources/:/app/classes/:/app/libs/* "tech.jhipster.registry.JHipsterRegistryApp" "$@"
4 changes: 0 additions & 4 deletions src/main/jib/entrypoint.sh

This file was deleted.

2 changes: 1 addition & 1 deletion src/test/resources/config/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jhipster:
authentication:
jwt:
# This token must be encoded using Base64 (you can type `echo 'secret-key'|base64` on your command line)
base64-secret: OTc1OGNjNmNiMTQ5NWIyNjdjYjAwNmUyYWFjNzQ1Njk2NDBkZGMyMzRmMzZiM2I3ZTllOGM4ZmE5NDA2MzA5ODdlODM5OGYxNzU4OGExNmM2N2Y5YzU0OWVjNWQ4NTA1OWQyMA==
base64-secret: NmQ3NTY1NjhlZGY2NmEzNzUxMjFkZDVmNTA3YjRiNWIxMzM2ZGRiNDNlYjFkMDc2YzdlYTgzYjVkNTNlZGU0NTdiNDg5OTUyNTZjYmNiYjlkMWNjNjE5MTE2NjVhZjM2MmZkYTdiYjRkNGZiMDU5MzhmMDIzYTE4ZjQ3ZTVmMTU=
# Token is valid 24 hours
token-validity-in-seconds: 86400
# ===================================================================
Expand Down

0 comments on commit 196479f

Please sign in to comment.