From 49a48b0dd58eefdb9184137262ca8a62680fdd8b Mon Sep 17 00:00:00 2001 From: Fritz Zaucker Date: Mon, 15 Mar 2021 09:45:13 +0100 Subject: [PATCH 01/15] Require none-beta Qooxdoo --- .../Author/generate/callbackery_app/frontend/Manifest.json | 4 ++-- .../Author/generate/callbackery_app/frontend/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Manifest.json b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Manifest.json index 522402c..3740ee9 100644 --- a/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Manifest.json +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Manifest.json @@ -24,7 +24,7 @@ "translation" : "source/translation" }, "requires": { - "@qooxdoo/framework": "^6.0.0-beta", - "@qooxdoo/compiler" : "^1.0.0-beta" + "@qooxdoo/framework": "^6.0.0", + "@qooxdoo/compiler" : "^1.0.0" } } diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/package.json b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/package.json index b87cdc3..dcba27b 100644 --- a/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/package.json +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/package.json @@ -1,5 +1,5 @@ { "devDependencies": { - "@qooxdoo/compiler": "^1.0.0-beta" + "@qooxdoo/compiler": "^1.0.0" } } From bb6ffa2199b5c4c01c8569135ab23d64f8d854f9 Mon Sep 17 00:00:00 2001 From: Fritz Zaucker Date: Mon, 12 Apr 2021 10:47:45 +0200 Subject: [PATCH 02/15] Use official schemata --- .../Author/generate/callbackery_app/frontend/Manifest.json | 2 +- .../Author/generate/callbackery_app/frontend/compile.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Manifest.json b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Manifest.json index 3740ee9..b9086f7 100644 --- a/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Manifest.json +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Manifest.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/qooxdoo/qooxdoo-compiler/master/source/resource/qx/tool/schema/Manifest-1-0-0.json", + "$schema": "https://qooxdoo.org/schema/Manifest-1-0-0.json", "info" : { "name" : "<%= ${class} %>", diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/compile.json b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/compile.json index 776a54e..143f524 100644 --- a/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/compile.json +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/compile.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/qooxdoo/qooxdoo-compiler/master/source/resource/qx/tool/schema/compile-1-0-0.json", + "$schema": "https://qooxdoo.org/schema/compile-1-0-0.json", "targets": [ { "type": "source", From 1137dfdc4e454426fdc4c18cbc29c09841a4aa71 Mon Sep 17 00:00:00 2001 From: Tobias Bossert Date: Thu, 29 Apr 2021 14:24:54 +0200 Subject: [PATCH 03/15] added ubuntu-package build, fixed automated unit tests --- .gitignore | 3 +- .../Command/Author/generate/automake_app.pm | 92 ++++++++++--------- .../build-release-action/Dockerfile-18.04 | 31 +++++++ .../build-release-action/Dockerfile-20.04 | 31 +++++++ .../actions/build-release-action/action.yaml | 31 +++++++ .../actions/build-release-action/make-deb.sh | 10 ++ .../.github/workflows/build-release.yaml | 33 +++++++ .../.github/workflows/unit-tests.yaml | 12 +-- .../Author/generate/automake_app/.gitignore | 6 +- .../Author/generate/automake_app/CHANGES | 6 +- .../Author/generate/automake_app/Makefile.am | 2 +- .../Author/generate/automake_app/README.md | 14 +++ .../generate/automake_app/debian/Makefile.am | 2 + .../generate/automake_app/debian/changelog | 10 ++ .../generate/automake_app/debian/compat | 1 + .../generate/automake_app/debian/control | 10 ++ .../Author/generate/automake_app/debian/rules | 17 ++++ .../generate/automake_app/etc/Makefile.am | 2 +- .../etc/{app.cfg => app.dist.cfg} | 0 .../Author/generate/automake_app/lib/App.pm | 2 +- .../generate/automake_app/t/etc/app.cfg | 3 + .../Author/generate/callbackery_app.pm | 13 ++- .../Author/generate/callbackery_app/README.md | 35 ++++--- .../generate/callbackery_app/t/etc/app.yaml | 30 ++++++ 24 files changed, 324 insertions(+), 72 deletions(-) create mode 100644 lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile-18.04 create mode 100644 lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile-20.04 create mode 100644 lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/action.yaml create mode 100755 lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/make-deb.sh create mode 100644 lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/build-release.yaml create mode 100644 lib/Mojolicious/Command/Author/generate/automake_app/debian/Makefile.am create mode 100644 lib/Mojolicious/Command/Author/generate/automake_app/debian/changelog create mode 100644 lib/Mojolicious/Command/Author/generate/automake_app/debian/compat create mode 100644 lib/Mojolicious/Command/Author/generate/automake_app/debian/control create mode 100755 lib/Mojolicious/Command/Author/generate/automake_app/debian/rules rename lib/Mojolicious/Command/Author/generate/automake_app/etc/{app.cfg => app.dist.cfg} (100%) create mode 100644 lib/Mojolicious/Command/Author/generate/automake_app/t/etc/app.cfg create mode 100644 lib/Mojolicious/Command/Author/generate/callbackery_app/t/etc/app.yaml diff --git a/.gitignore b/.gitignore index cde1fe3..493c21d 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,5 @@ my-call-backery-app/ dist.sh *~ .vscode -my-*-app \ No newline at end of file +my-*-app +.idea \ No newline at end of file diff --git a/lib/Mojolicious/Command/Author/generate/automake_app.pm b/lib/Mojolicious/Command/Author/generate/automake_app.pm index af1d4a6..1e759a8 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app.pm +++ b/lib/Mojolicious/Command/Author/generate/automake_app.pm @@ -49,37 +49,44 @@ sub rel_file { sub file { my $self = shift; - + # Configure Main Dir return { - 'configure.ac' => 'configure.ac', - 'bootstrap' => 'bootstrap', - 'cpanfile' => 'cpanfile', - 'VERSION' => 'VERSION', - 'README.md' => 'README.md', - 'AUTHORS' => 'AUTHORS', - '.gitignore' => '.gitignore', - '.github/workflows/unit-tests.yaml' => '.github/workflows/unit-tests.yaml', - 'LICENSE' => 'LICENSE', - 'COPYRIGHT' => 'COPYRIGHT', - 'CHANGES' => 'CHANGES', - 'Makefile.am' => 'Makefile.am', - 'bin/Makefile.am' => 'bin/Makefile.am', - 'thirdparty/Makefile.am' => 'thirdparty/Makefile.am', - 'etc/Makefile.am' => 'etc/Makefile.am', - 'etc/app.cfg' => 'etc/'.$self->filename.'.cfg', - 'bin/app.pl' => 'bin/'.$self->filename.'.pl', - 'lib/App.pm' => 'lib/'.$self->class_path, - 'lib/Makefile.am' => 'lib/Makefile.am', - 'lib/App/Controller/Example.pm' - => 'lib/'.$self->class.'/Controller/Example.pm', - 'public/index.html' - => 'public/index.html', - 'templates/layouts/default.html.ep' - => 'templates/layouts/default.html.ep', - 'templates/example/welcome.html.ep' - => 'templates/example/welcome.html.ep', - 't/basic.t' => 't/basic.t', + 'configure.ac' => 'configure.ac', + 'bootstrap' => 'bootstrap', + 'cpanfile' => 'cpanfile', + 'VERSION' => 'VERSION', + 'README.md' => 'README.md', + 'AUTHORS' => 'AUTHORS', + '.gitignore' => '.gitignore', + '.github/workflows/unit-tests.yaml' => '.github/workflows/unit-tests.yaml', + 'LICENSE' => 'LICENSE', + 'COPYRIGHT' => 'COPYRIGHT', + 'CHANGES' => 'CHANGES', + 'Makefile.am' => 'Makefile.am', + 'bin/Makefile.am' => 'bin/Makefile.am', + 'thirdparty/Makefile.am' => 'thirdparty/Makefile.am', + 'etc/Makefile.am' => 'etc/Makefile.am', + 'etc/app.dist.cfg' => 'etc/' . $self->filename . '.dist.cfg', + 'bin/app.pl' => 'bin/' . $self->filename . '.pl', + 'lib/App.pm' => 'lib/' . $self->class_path, + 'lib/Makefile.am' => 'lib/Makefile.am', + 'lib/App/Controller/Example.pm' => 'lib/' . $self->class . '/Controller/Example.pm', + 'public/index.html' => 'public/index.html', + 'templates/layouts/default.html.ep' => 'templates/layouts/default.html.ep', + 'templates/example/welcome.html.ep' => 'templates/example/welcome.html.ep', + 't/basic.t' => 't/basic.t', + 't/etc/app.cfg' => 't/etc/' . $self->filename . '.cfg', + 'debian/control' => 'debian/control', + 'debian/changelog' => 'debian/changelog', + 'debian/compat' => 'debian/compat', + 'debian/rules' => 'debian/rules', + 'debian/Makefile.am' => 'debian/Makefile.am', + '.github/actions/build-release-action/action.yaml' => '.github/actions/build-release-action/action.yaml', + '.github/actions/build-release-action/Dockerfile-18.04' => '.github/actions/build-release-action/Dockerfile-18.04', + '.github/actions/build-release-action/Dockerfile-20.04' => '.github/actions/build-release-action/Dockerfile-20.04', + '.github/actions/build-release-action/make-deb.sh' => '.github/actions/build-release-action/make-deb.sh', + '.github/workflows/build-release.yaml' => '.github/workflows/build-release.yaml' }; } @@ -119,18 +126,19 @@ EOF $in =~ /email\s*=\s*(\S+)/ and $email = $1; } - for my $key (keys %$file){ - $self->render_to_rel_file($key, $self->filename.'/'.$file->{$key}, { - class => $self->class, - 'package' => $self->package, - filename => $self->filename, - class_file => $self->class_file, - class_path => $self->class_path, - year => (localtime time)[5]+1900, - email => $email, - fullName => $fullName, - userName => $userName, - date => strftime('%Y-%m-%d',localtime(time)), + for my $key (keys %$file) { + $self->render_to_rel_file($key, $self->filename . '/' . $file->{$key}, { + class => $self->class, + 'package' => $self->package, + filename => $self->filename, + class_file => $self->class_file, + class_path => $self->class_path, + year => (localtime time)[5] + 1900, + email => $email, + fullName => $fullName, + userName => $userName, + date => strftime('%Y-%m-%d', localtime(time)), + date_rfc2822 => strftime('%a, %d %b %Y %H:%M:%S %z', localtime(time)) }); } @@ -184,7 +192,7 @@ Mojolicious::Command::Author::generate::automake_app - Mojolicious App generator =head1 DESCRIPTION -L generates application directory structures for fully functional L applications. +L generates application directory structures for fully functional L applications. =head1 SEE ALSO diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile-18.04 b/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile-18.04 new file mode 100644 index 0000000..ffaf78d --- /dev/null +++ b/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile-18.04 @@ -0,0 +1,31 @@ +FROM ubuntu:18.04 + +LABEL maintainer="oetiker" \ + description="WG-wrangler builder" + + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get -y update && \ + apt-get -y install apt-utils curl && \ + curl https://deb.nodesource.com/setup_12.x | bash && \ + apt-get -u update && \ + apt-get -y install perl \ + make \ + gcc \ + devscripts \ + openssl \ + pkg-config \ + libssl-dev \ + debhelper \ + automake \ + nodejs \ + libkrb5-dev \ + libqrencode-dev \ + g++ + +COPY make-deb.sh /make-deb.sh + +RUN chmod 777 /make-deb.sh + +ENTRYPOINT ["/make-deb.sh"] diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile-20.04 b/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile-20.04 new file mode 100644 index 0000000..2ab2008 --- /dev/null +++ b/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile-20.04 @@ -0,0 +1,31 @@ +FROM ubuntu:20.04 + +LABEL maintainer="oetiker" \ + description="WG-wrangler builder" + + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get -y update && \ + apt-get -y install apt-utils curl && \ + curl https://deb.nodesource.com/setup_12.x | bash && \ + apt-get -u update && \ + apt-get -y install perl \ + make \ + gcc \ + devscripts \ + openssl \ + pkg-config \ + libssl-dev \ + debhelper \ + automake \ + nodejs \ + libkrb5-dev \ + libqrencode-dev \ + g++ + +COPY make-deb.sh /make-deb.sh + +RUN chmod 777 /make-deb.sh + +ENTRYPOINT ["/make-deb.sh"] diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/action.yaml b/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/action.yaml new file mode 100644 index 0000000..fa0e343 --- /dev/null +++ b/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/action.yaml @@ -0,0 +1,31 @@ +name: 'Docker release builder' +description: 'Build release packages using a docker image' + +inputs: + docker_file: + description: Target Docker file to build package + required: true + +outputs: + package_name: + description: name of the generated package + value: ${{ steps.run.outputs.package_name }} + +runs: + using: 'composite' + steps: + - id: build + name: Build Docker Image + run: | + docker build \ + -f $(pwd)/.github/actions/build-release-action/${{inputs.docker_file}} \ + $(pwd)/.github/actions/build-release-action/ \ + -t deb_builder:latest + shell: bash + - id: run + name: Run Docker Image + run: docker run -v $(pwd):/github/workspace --workdir /github/workspace deb_builder:latest + shell: bash + + + diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/make-deb.sh b/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/make-deb.sh new file mode 100755 index 0000000..dc404fa --- /dev/null +++ b/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/make-deb.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -ex +cd /github/workspace/ +dh_clean +dpkg-buildpackage -us -uc -nc +release_code_name=$(lsb_release --codename | sed 's/Codename:\s*//') +package_name=$(basename ../*.deb | sed 's/.deb$//')_$release_code_name.deb + +mv ../*.deb $package_name +echo "::set-output name=package_name::$package_name" diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/build-release.yaml b/lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/build-release.yaml new file mode 100644 index 0000000..a384779 --- /dev/null +++ b/lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/build-release.yaml @@ -0,0 +1,33 @@ +name: 'Build release' +on: + push: + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + build_deb: + strategy: + matrix: + RELEASE: + - Dockerfile-20.04 + - Dockerfile-18.04 +# - YourVeryCustomDockerFiler + runs-on: ubuntu-latest + name: Build package defined in ${{ matrix.RELEASE }} + steps: + - uses: actions/checkout@v1 + - name: Run docker build + id: build_package + uses: ./.github/actions/build-release-action + with: + docker_file: ${{ matrix.RELEASE }} + + - name: Release deb files + uses: softprops/action-gh-release@v1 + with: + files: ${{ github.workspace }}/${{ steps.build_package.outputs.package_name }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + + diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/unit-tests.yaml b/lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/unit-tests.yaml index 8f82bfc..94130db 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/unit-tests.yaml +++ b/lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/unit-tests.yaml @@ -27,7 +27,7 @@ jobs: % if ($package eq 'callbackery' ) { node: # - '10.x' - - '13.x' + - '12.x' % } # exclude: #- os: ubuntu-16.04 @@ -101,13 +101,7 @@ jobs: run: make - name: Test - run: | -% if ($package eq 'callbackery' ) { - cp etc/<%= $filename %>.dist.yaml etc/<%= $filename %>.yaml -% } else { - cp etc/<%= $filename %>.cfg.dist etc/<%= $filename %>.cfg -% } - make test + run: make test - name: Dist run: make dist @@ -124,7 +118,7 @@ jobs: % if ($package eq 'callbackery' ) { cp etc/<%= $filename %>.dist.yaml etc/<%= $filename %>.yaml % } else { - cp etc/<%= $filename %>.cfg.dist etc/<%= $filename %>.cfg + cp etc/<%= $filename %>.dist.cfg etc/<%= $filename %>.cfg % } ./bin/<%= $filename %>.pl diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/.gitignore b/lib/Mojolicious/Command/Author/generate/automake_app/.gitignore index 626526a..b2a956b 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app/.gitignore +++ b/lib/Mojolicious/Command/Author/generate/automake_app/.gitignore @@ -39,4 +39,8 @@ conftoools/ /.vscode/perl-lang/ frontend/node_modules/ frontend/qx_packages/ -/configure \ No newline at end of file +/configure +debian/.debhelper +debian/files +debian/<%= ${class} %> +debian/<%= ${class} %>.* \ No newline at end of file diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/CHANGES b/lib/Mojolicious/Command/Author/generate/automake_app/CHANGES index f72ffcb..a914ae5 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app/CHANGES +++ b/lib/Mojolicious/Command/Author/generate/automake_app/CHANGES @@ -1,4 +1,6 @@ -0.0.0 <%= "${date} ${fullName} (${email})" %> +<%= "${filename} (0.0.0) unstable; urgency=medium" %> -- started project + * Initial release + + -- <%= "${fullName} <${email}> ${date_rfc2822}" %> diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/Makefile.am b/lib/Mojolicious/Command/Author/generate/automake_app/Makefile.am index b9f9d2c..3aa6a91 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app/Makefile.am +++ b/lib/Mojolicious/Command/Author/generate/automake_app/Makefile.am @@ -43,4 +43,4 @@ share/messages.pot: $(PM) $(CALLBACKERY_PM) % } test: - prove -w + $(MJ_CLASS)_CONFIG=t/etc/<%= ${filename} %>.cfg prove -w diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/README.md b/lib/Mojolicious/Command/Author/generate/automake_app/README.md index 1f2b814..b25f9b3 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app/README.md +++ b/lib/Mojolicious/Command/Author/generate/automake_app/README.md @@ -71,6 +71,20 @@ all the right versions of the dependent modules get installed. make dist ``` +Github Actions +-------------- + +This project has a package action (e.g to build a `.deb` package) built-in. To add your own build-pipeline, simply +create a corresponding DockerFile under `.github/actions/build-release-action/` and register it in the strategy section +of the `build-relase.yaml`-file. It is expected that your Docker-Pipeline returns the filename of the built package. This +can be achieved by the following snippet at the end of your script: + +```text +echo "::set-output name=package_name::$package_name" +``` + +The action is triggered when committing a new tag that matches this pattern: `v*` + Enjoy! <%= "${fullName} <${email}>" %> diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/debian/Makefile.am b/lib/Mojolicious/Command/Author/generate/automake_app/debian/Makefile.am new file mode 100644 index 0000000..e53a810 --- /dev/null +++ b/lib/Mojolicious/Command/Author/generate/automake_app/debian/Makefile.am @@ -0,0 +1,2 @@ +changelog: ../CHANGES: + cp ../CHANGES changelog \ No newline at end of file diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/debian/changelog b/lib/Mojolicious/Command/Author/generate/automake_app/debian/changelog new file mode 100644 index 0000000..d01759d --- /dev/null +++ b/lib/Mojolicious/Command/Author/generate/automake_app/debian/changelog @@ -0,0 +1,10 @@ +<%= "${filename} (0.0.0) unstable; urgency=medium" %> + + * Initial deb release + + -- <%= "${fullName} <${email}> ${date_rfc2822}" %> + + + + + diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/debian/compat b/lib/Mojolicious/Command/Author/generate/automake_app/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/lib/Mojolicious/Command/Author/generate/automake_app/debian/compat @@ -0,0 +1 @@ +9 diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/debian/control b/lib/Mojolicious/Command/Author/generate/automake_app/debian/control new file mode 100644 index 0000000..65375d8 --- /dev/null +++ b/lib/Mojolicious/Command/Author/generate/automake_app/debian/control @@ -0,0 +1,10 @@ +Source: <%= "${filename}" %> +Section: system +Priority: optional +Maintainer: <%= "${fullName} <${email}>" %> +Build-Depends: build-essential, debhelper (>= 9) + +Package: <%= "${filename}" %> +Architecture: any +Depends: ${shlibs:Depends}, perl +Description: <%= "${class}" %> - An awesome application! diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/debian/rules b/lib/Mojolicious/Command/Author/generate/automake_app/debian/rules new file mode 100755 index 0000000..3b813f3 --- /dev/null +++ b/lib/Mojolicious/Command/Author/generate/automake_app/debian/rules @@ -0,0 +1,17 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + +# This has to be exported to make some magic below work. +export DH_OPTIONS + +export DH_ALWAYS_EXCLUDE=CVS:.svn:.git: + +override_dh_auto_configure: + ./bootstrap + ./configure --prefix=/opt/wgwrangler + +%%: + dh $@ diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/etc/Makefile.am b/lib/Mojolicious/Command/Author/generate/automake_app/etc/Makefile.am index 5c65d6a..b82e1a7 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app/etc/Makefile.am +++ b/lib/Mojolicious/Command/Author/generate/automake_app/etc/Makefile.am @@ -1,4 +1,4 @@ -ETC = <%= ${filename} %>.cfg +ETC = <%= ${filename} %>.dist.cfg EXTRA_DIST = $(ETC) sysconf_DATA = $(ETC) diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/etc/app.cfg b/lib/Mojolicious/Command/Author/generate/automake_app/etc/app.dist.cfg similarity index 100% rename from lib/Mojolicious/Command/Author/generate/automake_app/etc/app.cfg rename to lib/Mojolicious/Command/Author/generate/automake_app/etc/app.dist.cfg diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/lib/App.pm b/lib/Mojolicious/Command/Author/generate/automake_app/lib/App.pm index e358993..725929b 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app/lib/App.pm +++ b/lib/Mojolicious/Command/Author/generate/automake_app/lib/App.pm @@ -7,7 +7,7 @@ sub startup { # Load configuration from hash returned by config file my $config = $self->plugin('Config', - file => $self->home->rel_file('etc/<%= ${filename} %>.cfg') + file => $ENV{<%= ${class} %>_CONFIG} || $self->home->rel_file('etc/<%= ${filename} %>.cfg') ); # Configure the application diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/t/etc/app.cfg b/lib/Mojolicious/Command/Author/generate/automake_app/t/etc/app.cfg new file mode 100644 index 0000000..e77699c --- /dev/null +++ b/lib/Mojolicious/Command/Author/generate/automake_app/t/etc/app.cfg @@ -0,0 +1,3 @@ +{ + secrets => ['<%= int(rand()*1000000000000+1123443024) %>'] +} diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app.pm b/lib/Mojolicious/Command/Author/generate/callbackery_app.pm index 158b59d..7f0119e 100644 --- a/lib/Mojolicious/Command/Author/generate/callbackery_app.pm +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app.pm @@ -52,6 +52,17 @@ sub file { 'frontend/source/class/app/__init__.js' => 'frontend/source/class/'.$self->class_file.'/__init__.js', 'frontend/source/class/app/theme/Theme.js' => 'frontend/source/class/'.$self->class_file.'/theme/Theme.js', 't/basic.t' => 't/basic.t', + 't/etc/app.yaml' => 't/etc/' . $self->filename . '.yaml', + 'debian/control' => 'debian/control', + 'debian/changelog' => 'debian/changelog', + 'debian/compat' => 'debian/compat', + 'debian/rules' => 'debian/rules', + 'debian/Makefile.am' => 'debian/Makefile.am', + '.github/actions/build-release-action/action.yaml' => '.github/actions/build-release-action/action.yaml', + '.github/actions/build-release-action/Dockerfile-18.04' => '.github/actions/build-release-action/Dockerfile-18.04', + '.github/actions/build-release-action/Dockerfile-20.04' => '.github/actions/build-release-action/Dockerfile-20.04', + '.github/actions/build-release-action/make-deb.sh' => '.github/actions/build-release-action/make-deb.sh', + '.github/workflows/build-release.yaml' => '.github/workflows/build-release.yaml', }; } @@ -92,7 +103,7 @@ Mojolicious::Command::Author::generate::calbackery_app - Callbackery App generat =head1 DESCRIPTION -L generates application directory structures for fully functional L applications. +L generates application directory structures for fully functional L applications. =head1 SEE ALSO diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app/README.md b/lib/Mojolicious/Command/Author/generate/callbackery_app/README.md index 4186d0a..b82a878 100644 --- a/lib/Mojolicious/Command/Author/generate/callbackery_app/README.md +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app/README.md @@ -1,7 +1,6 @@ <%= ${class} %> =========== -Version: #VERSION# -Date: #DATE# +Version: #VERSION# Date: #DATE# <%= ${class} %> is a cool web application. @@ -18,17 +17,15 @@ In your app source directory and start building. make ``` -Configure will check if all requirements are met and give -hints on how to fix the situation if something is missing. +Configure will check if all requirements are met and give hints on how to fix the situation if something is missing. Any missing perl modules will be downloaded and built. Development ----------- -While developing the application it is convenient to NOT have to install it -before runnning. You can actually serve the Qooxdoo source directly -using the built-in Mojo webserver. +While developing the application it is convenient to NOT have to install it before runnning. You can actually serve the +Qooxdoo source directly using the built-in Mojo webserver. ```console ./bin/<%= ${filename} %>-source-mode.sh @@ -61,18 +58,30 @@ Packaging Before releasing, make sure to update `CHANGES`, `VERSION` and run `./bootstrap`. -You can also package the application as a nice tar.gz file, it uses carton to -install dependent module. If you want to make sure that your project builds with perl -5.22, make sure to set the `PERL` environment variable to a perl 5.22 +You can also package the application as a nice tar.gz file, it uses carton to install dependent module. If you want to +make sure that your project builds with perl 5.22, make sure to set the `PERL` environment variable to a perl 5.22 interpreter, make sure to delete any `PERL5LIB` environment variable, and run -`make clean && make`. This will cause a `cpanfile-5.22.1.snapshot` file to be included -with your tar ball, when building the app this snapshot will be used to make sure -all the right versions of the dependent modules get installed. +`make clean && make`. This will cause a `cpanfile-5.22.1.snapshot` file to be included with your tar ball, when building +the app this snapshot will be used to make sure all the right versions of the dependent modules get installed. ```console make dist ``` +Github Actions +-------------- + +This project has a package action (e.g to build a `.deb` package) built-in. To add your own build-pipeline, simply +create a corresponding DockerFile under `.github/actions/build-release-action/` and register it in the strategy section +of the `build-relase.yaml`-file. It is expected that your Docker-Pipeline returns the filename of the built package. This +can be achieved by the following snippet at the end of your script: + +```text +echo "::set-output name=package_name::$package_name" +``` + +The action is triggered when committing a new tag that matches this pattern: `v*` + Enjoy! <%= "${fullName} <${email}>" %> diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app/t/etc/app.yaml b/lib/Mojolicious/Command/Author/generate/callbackery_app/t/etc/app.yaml new file mode 100644 index 0000000..8199ed2 --- /dev/null +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app/t/etc/app.yaml @@ -0,0 +1,30 @@ + +BACKEND: + cfg_db: /tmp/<%= ${filename} %>.db + sesame_user: adfadsfasdf4ee3r +# perl -MDigest::SHA -e 'print Digest::SHA::hmac_sha1_hex("access"),"\n"' + sesame_pass: 393afhkjhffjj + +FRONTEND: +# logo = ../resource/<%= ${filename} %>/logo.png +# logo_small = ../resource/<%= ${filename} %>/logo-small.png + title: Song List + initial_plugin: Songs + company_name: OETIKER+PARTNER AG + company_url: http://www.oetiker.ch +# max_width = 800 + +PLUGIN: + - InitialUser: + module: UserForm + mode: init + type: add + tab-name: Create Initial User + + - Songs: + module: Song + tab-name: Songs + + - AdminUser: + module: Users + tab-name: Admin User Manager From 8c27e6bbe9e9849259287861420a176bde5cd680 Mon Sep 17 00:00:00 2001 From: Tobias Bossert Date: Thu, 29 Apr 2021 14:36:26 +0200 Subject: [PATCH 04/15] removed wg-wrangler reference... --- .../Command/Author/generate/automake_app/debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/debian/rules b/lib/Mojolicious/Command/Author/generate/automake_app/debian/rules index 3b813f3..7b5e1e5 100755 --- a/lib/Mojolicious/Command/Author/generate/automake_app/debian/rules +++ b/lib/Mojolicious/Command/Author/generate/automake_app/debian/rules @@ -11,7 +11,7 @@ export DH_ALWAYS_EXCLUDE=CVS:.svn:.git: override_dh_auto_configure: ./bootstrap - ./configure --prefix=/opt/wgwrangler + ./configure --prefix=/opt/<%= ${filename} %> %%: dh $@ From 42bf232316cf09f2c79fe60bd5c0553df7cf2dff Mon Sep 17 00:00:00 2001 From: Tobias Bossert Date: Thu, 29 Apr 2021 14:40:17 +0200 Subject: [PATCH 05/15] made diff easier to compare --- .../Command/Author/generate/automake_app.pm | 52 ++++++++++--------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/lib/Mojolicious/Command/Author/generate/automake_app.pm b/lib/Mojolicious/Command/Author/generate/automake_app.pm index 1e759a8..3b83362 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app.pm +++ b/lib/Mojolicious/Command/Author/generate/automake_app.pm @@ -52,30 +52,34 @@ sub file { # Configure Main Dir return { - 'configure.ac' => 'configure.ac', - 'bootstrap' => 'bootstrap', - 'cpanfile' => 'cpanfile', - 'VERSION' => 'VERSION', - 'README.md' => 'README.md', - 'AUTHORS' => 'AUTHORS', - '.gitignore' => '.gitignore', - '.github/workflows/unit-tests.yaml' => '.github/workflows/unit-tests.yaml', - 'LICENSE' => 'LICENSE', - 'COPYRIGHT' => 'COPYRIGHT', - 'CHANGES' => 'CHANGES', - 'Makefile.am' => 'Makefile.am', - 'bin/Makefile.am' => 'bin/Makefile.am', - 'thirdparty/Makefile.am' => 'thirdparty/Makefile.am', - 'etc/Makefile.am' => 'etc/Makefile.am', - 'etc/app.dist.cfg' => 'etc/' . $self->filename . '.dist.cfg', - 'bin/app.pl' => 'bin/' . $self->filename . '.pl', - 'lib/App.pm' => 'lib/' . $self->class_path, - 'lib/Makefile.am' => 'lib/Makefile.am', - 'lib/App/Controller/Example.pm' => 'lib/' . $self->class . '/Controller/Example.pm', - 'public/index.html' => 'public/index.html', - 'templates/layouts/default.html.ep' => 'templates/layouts/default.html.ep', - 'templates/example/welcome.html.ep' => 'templates/example/welcome.html.ep', - 't/basic.t' => 't/basic.t', + 'configure.ac' => 'configure.ac', + 'bootstrap' => 'bootstrap', + 'cpanfile' => 'cpanfile', + 'VERSION' => 'VERSION', + 'README.md' => 'README.md', + 'AUTHORS' => 'AUTHORS', + '.gitignore' => '.gitignore', + '.github/workflows/unit-tests.yaml' => '.github/workflows/unit-tests.yaml', + 'LICENSE' => 'LICENSE', + 'COPYRIGHT' => 'COPYRIGHT', + 'CHANGES' => 'CHANGES', + 'Makefile.am' => 'Makefile.am', + 'bin/Makefile.am' => 'bin/Makefile.am', + 'thirdparty/Makefile.am' => 'thirdparty/Makefile.am', + 'etc/Makefile.am' => 'etc/Makefile.am', + 'etc/app.dist.cfg' => 'etc/'.$self->filename.'.dist.cfg', + 'bin/app.pl' => 'bin/'.$self->filename.'.pl', + 'lib/App.pm' => 'lib/'.$self->class_path, + 'lib/Makefile.am' => 'lib/Makefile.am', + 'lib/App/Controller/Example.pm' + => 'lib/'.$self->class.'/Controller/Example.pm', + 'public/index.html' + => 'public/index.html', + 'templates/layouts/default.html.ep' + => 'templates/layouts/default.html.ep', + 'templates/example/welcome.html.ep' + => 'templates/example/welcome.html.ep', + 't/basic.t' => 't/basic.t', 't/etc/app.cfg' => 't/etc/' . $self->filename . '.cfg', 'debian/control' => 'debian/control', 'debian/changelog' => 'debian/changelog', From 50f95c15e40de87431b9dea7f209164ff5d7e956 Mon Sep 17 00:00:00 2001 From: Tobias Bossert Date: Thu, 29 Apr 2021 15:58:52 +0200 Subject: [PATCH 06/15] Simplified docker setup --- .../Command/Author/generate/automake_app.pm | 21 ++++++------- .../{Dockerfile-18.04 => Dockerfile} | 4 ++- .../build-release-action/Dockerfile-20.04 | 31 ------------------- .../actions/build-release-action/action.yaml | 5 +++ .../.github/workflows/build-release.yaml | 15 ++++++--- .../Author/generate/automake_app/Makefile.am | 2 +- .../Author/generate/callbackery_app.pm | 3 +- 7 files changed, 30 insertions(+), 51 deletions(-) rename lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/{Dockerfile-18.04 => Dockerfile} (91%) delete mode 100644 lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile-20.04 diff --git a/lib/Mojolicious/Command/Author/generate/automake_app.pm b/lib/Mojolicious/Command/Author/generate/automake_app.pm index 3b83362..d38b1fd 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app.pm +++ b/lib/Mojolicious/Command/Author/generate/automake_app.pm @@ -80,17 +80,16 @@ sub file { 'templates/example/welcome.html.ep' => 'templates/example/welcome.html.ep', 't/basic.t' => 't/basic.t', - 't/etc/app.cfg' => 't/etc/' . $self->filename . '.cfg', - 'debian/control' => 'debian/control', - 'debian/changelog' => 'debian/changelog', - 'debian/compat' => 'debian/compat', - 'debian/rules' => 'debian/rules', - 'debian/Makefile.am' => 'debian/Makefile.am', - '.github/actions/build-release-action/action.yaml' => '.github/actions/build-release-action/action.yaml', - '.github/actions/build-release-action/Dockerfile-18.04' => '.github/actions/build-release-action/Dockerfile-18.04', - '.github/actions/build-release-action/Dockerfile-20.04' => '.github/actions/build-release-action/Dockerfile-20.04', - '.github/actions/build-release-action/make-deb.sh' => '.github/actions/build-release-action/make-deb.sh', - '.github/workflows/build-release.yaml' => '.github/workflows/build-release.yaml' + 't/etc/app.cfg' => 't/etc/' . $self->filename . '.cfg', + 'debian/control' => 'debian/control', + 'debian/changelog' => 'debian/changelog', + 'debian/compat' => 'debian/compat', + 'debian/rules' => 'debian/rules', + 'debian/Makefile.am' => 'debian/Makefile.am', + '.github/actions/build-release-action/action.yaml' => '.github/actions/build-release-action/action.yaml', + '.github/actions/build-release-action/Dockerfile' => '.github/actions/build-release-action/Dockerfile', + '.github/actions/build-release-action/make-deb.sh' => '.github/actions/build-release-action/make-deb.sh', + '.github/workflows/build-release.yaml' => '.github/workflows/build-release.yaml' }; } diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile-18.04 b/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile similarity index 91% rename from lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile-18.04 rename to lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile index ffaf78d..f855f6d 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile-18.04 +++ b/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile @@ -1,4 +1,6 @@ -FROM ubuntu:18.04 +ARG IMAGE_VERSION_TAG + +FROM ubuntu:$IMAGE_VERSION_TAG LABEL maintainer="oetiker" \ description="WG-wrangler builder" diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile-20.04 b/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile-20.04 deleted file mode 100644 index 2ab2008..0000000 --- a/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile-20.04 +++ /dev/null @@ -1,31 +0,0 @@ -FROM ubuntu:20.04 - -LABEL maintainer="oetiker" \ - description="WG-wrangler builder" - - -ENV DEBIAN_FRONTEND noninteractive - -RUN apt-get -y update && \ - apt-get -y install apt-utils curl && \ - curl https://deb.nodesource.com/setup_12.x | bash && \ - apt-get -u update && \ - apt-get -y install perl \ - make \ - gcc \ - devscripts \ - openssl \ - pkg-config \ - libssl-dev \ - debhelper \ - automake \ - nodejs \ - libkrb5-dev \ - libqrencode-dev \ - g++ - -COPY make-deb.sh /make-deb.sh - -RUN chmod 777 /make-deb.sh - -ENTRYPOINT ["/make-deb.sh"] diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/action.yaml b/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/action.yaml index fa0e343..8a33350 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/action.yaml +++ b/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/action.yaml @@ -5,6 +5,10 @@ inputs: docker_file: description: Target Docker file to build package required: true + image_version_tag: + description: Tag which is prepended on the FROM directive + required: false + default: latest outputs: package_name: @@ -18,6 +22,7 @@ runs: name: Build Docker Image run: | docker build \ + --build-arg IMAGE_VERSION_TAG=${{inputs.image_version_tag}} \ -f $(pwd)/.github/actions/build-release-action/${{inputs.docker_file}} \ $(pwd)/.github/actions/build-release-action/ \ -t deb_builder:latest diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/build-release.yaml b/lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/build-release.yaml index a384779..49d74fc 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/build-release.yaml +++ b/lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/build-release.yaml @@ -9,18 +9,23 @@ jobs: strategy: matrix: RELEASE: - - Dockerfile-20.04 - - Dockerfile-18.04 -# - YourVeryCustomDockerFiler + - Ubuntu: + docker_file: Dockerfile + image_version_tag: '18.04' + - Ubuntu: + docker_file: Dockerfile + image_version_tag: '20.04' + runs-on: ubuntu-latest - name: Build package defined in ${{ matrix.RELEASE }} + name: Build package defined in ${{ matrix.RELEASE.docker_file }} for tag {{$matrix.RELEASE.image_version_tag}} steps: - uses: actions/checkout@v1 - name: Run docker build id: build_package uses: ./.github/actions/build-release-action with: - docker_file: ${{ matrix.RELEASE }} + docker_file: ${{ matrix.RELEASE.docker_file }} + image_version_tag: ${{ matrix.RELEASE.image_version_tag }} - name: Release deb files uses: softprops/action-gh-release@v1 diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/Makefile.am b/lib/Mojolicious/Command/Author/generate/automake_app/Makefile.am index 3aa6a91..66c2cb2 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app/Makefile.am +++ b/lib/Mojolicious/Command/Author/generate/automake_app/Makefile.am @@ -43,4 +43,4 @@ share/messages.pot: $(PM) $(CALLBACKERY_PM) % } test: - $(MJ_CLASS)_CONFIG=t/etc/<%= ${filename} %>.cfg prove -w + $(MJ_CLASS)_CONFIG=t/etc/<%= ${filename} %>.<%= ${package} eq 'callbackery' ? 'yaml' : 'cfg' %> prove -w diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app.pm b/lib/Mojolicious/Command/Author/generate/callbackery_app.pm index 7f0119e..879cd7d 100644 --- a/lib/Mojolicious/Command/Author/generate/callbackery_app.pm +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app.pm @@ -59,8 +59,7 @@ sub file { 'debian/rules' => 'debian/rules', 'debian/Makefile.am' => 'debian/Makefile.am', '.github/actions/build-release-action/action.yaml' => '.github/actions/build-release-action/action.yaml', - '.github/actions/build-release-action/Dockerfile-18.04' => '.github/actions/build-release-action/Dockerfile-18.04', - '.github/actions/build-release-action/Dockerfile-20.04' => '.github/actions/build-release-action/Dockerfile-20.04', + '.github/actions/build-release-action/Dockerfile' => '.github/actions/build-release-action/Dockerfile', '.github/actions/build-release-action/make-deb.sh' => '.github/actions/build-release-action/make-deb.sh', '.github/workflows/build-release.yaml' => '.github/workflows/build-release.yaml', }; From 4571e320496231fe0f4162342789a45cc0f09020 Mon Sep 17 00:00:00 2001 From: Tobias Bossert Date: Wed, 5 May 2021 13:10:48 +0200 Subject: [PATCH 07/15] Added workaround for debhelper bug, fixed yaml syntax in build-release.yaml --- .../actions/build-release-action/make-deb.sh | 13 +++++++++++-- .../.github/workflows/build-release.yaml | 15 ++++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/make-deb.sh b/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/make-deb.sh index dc404fa..9e83dbd 100755 --- a/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/make-deb.sh +++ b/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/make-deb.sh @@ -1,10 +1,19 @@ #!/bin/sh set -ex cd /github/workspace/ + +# workaround for debhelper bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=897569 +mkdir -p deb_build_home +ls | grep -v deb_build_home | xargs mv -t deb_build_home # move everything except deb_build_home +cd deb_build_home + dh_clean dpkg-buildpackage -us -uc -nc + +# set filename release_code_name=$(lsb_release --codename | sed 's/Codename:\s*//') package_name=$(basename ../*.deb | sed 's/.deb$//')_$release_code_name.deb +mv ../*.deb ../$package_name -mv ../*.deb $package_name -echo "::set-output name=package_name::$package_name" +# set action output +echo "::set-output name=package_name::$package_name" \ No newline at end of file diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/build-release.yaml b/lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/build-release.yaml index 49d74fc..9726b80 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/build-release.yaml +++ b/lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/build-release.yaml @@ -8,24 +8,25 @@ jobs: build_deb: strategy: matrix: - RELEASE: - - Ubuntu: + fail-fast: false + include: + - ubuntu: 18.04 docker_file: Dockerfile image_version_tag: '18.04' - - Ubuntu: + - ubuntu: 20.04 docker_file: Dockerfile - image_version_tag: '20.04' + image_version_tag: '18.04' runs-on: ubuntu-latest - name: Build package defined in ${{ matrix.RELEASE.docker_file }} for tag {{$matrix.RELEASE.image_version_tag}} + name: Build package defined in ${{ matrix.docker_file }} for tag {{$matrix.image_version_tag}} steps: - uses: actions/checkout@v1 - name: Run docker build id: build_package uses: ./.github/actions/build-release-action with: - docker_file: ${{ matrix.RELEASE.docker_file }} - image_version_tag: ${{ matrix.RELEASE.image_version_tag }} + docker_file: ${{ matrix.docker_file }} + image_version_tag: ${{ matrix.image_version_tag }} - name: Release deb files uses: softprops/action-gh-release@v1 From b15ea2335c594db4e5e410db17c9c061e5a58fa5 Mon Sep 17 00:00:00 2001 From: Tobias Bossert Date: Fri, 7 May 2021 14:18:06 +0200 Subject: [PATCH 08/15] Implemented PR-feedback, set config-dir to /etc/opt/ when building a .deb --- .../.github/actions/build-release-action/Dockerfile | 4 ++-- .../Command/Author/generate/automake_app/.gitignore | 1 - .../Command/Author/generate/automake_app/debian/Makefile.am | 2 +- .../Command/Author/generate/automake_app/debian/rules | 2 +- .../Command/Author/generate/automake_app/t/etc/app.cfg | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile b/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile index f855f6d..7ed5c9c 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile +++ b/lib/Mojolicious/Command/Author/generate/automake_app/.github/actions/build-release-action/Dockerfile @@ -2,8 +2,8 @@ ARG IMAGE_VERSION_TAG FROM ubuntu:$IMAGE_VERSION_TAG -LABEL maintainer="oetiker" \ - description="WG-wrangler builder" +LABEL maintainer="<%= ${email} %>" \ + description="<%= ${class} %> builder" ENV DEBIAN_FRONTEND noninteractive diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/.gitignore b/lib/Mojolicious/Command/Author/generate/automake_app/.gitignore index b2a956b..f8a1666 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app/.gitignore +++ b/lib/Mojolicious/Command/Author/generate/automake_app/.gitignore @@ -42,5 +42,4 @@ frontend/qx_packages/ /configure debian/.debhelper debian/files -debian/<%= ${class} %> debian/<%= ${class} %>.* \ No newline at end of file diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/debian/Makefile.am b/lib/Mojolicious/Command/Author/generate/automake_app/debian/Makefile.am index e53a810..7e61af3 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app/debian/Makefile.am +++ b/lib/Mojolicious/Command/Author/generate/automake_app/debian/Makefile.am @@ -1,2 +1,2 @@ changelog: ../CHANGES: - cp ../CHANGES changelog \ No newline at end of file + cp ../CHANGES changelog diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/debian/rules b/lib/Mojolicious/Command/Author/generate/automake_app/debian/rules index 7b5e1e5..179a9e5 100755 --- a/lib/Mojolicious/Command/Author/generate/automake_app/debian/rules +++ b/lib/Mojolicious/Command/Author/generate/automake_app/debian/rules @@ -11,7 +11,7 @@ export DH_ALWAYS_EXCLUDE=CVS:.svn:.git: override_dh_auto_configure: ./bootstrap - ./configure --prefix=/opt/<%= ${filename} %> + ./configure --prefix=/opt/<%= ${filename} %> --sysconfdir=/etc/opt/<%= ${filename} %> --localstatedir=/var/opt/<%= ${filename} %> %%: dh $@ diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/t/etc/app.cfg b/lib/Mojolicious/Command/Author/generate/automake_app/t/etc/app.cfg index e77699c..0b7fb41 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app/t/etc/app.cfg +++ b/lib/Mojolicious/Command/Author/generate/automake_app/t/etc/app.cfg @@ -1,3 +1,3 @@ { - secrets => ['<%= int(rand()*1000000000000+1123443024) %>'] + secrets => 'this_is_a_dummy_secret' } From ddcb193a2dd68d7a173e84772d409459ed72e7e3 Mon Sep 17 00:00:00 2001 From: Zakariyya Mughal Date: Tue, 7 Sep 2021 03:45:58 -0400 Subject: [PATCH 09/15] Add check for Node v14 --- .../Command/Author/generate/automake_app/configure.ac | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/configure.ac b/lib/Mojolicious/Command/Author/generate/automake_app/configure.ac index 0f595d1..d500cd1 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app/configure.ac +++ b/lib/Mojolicious/Command/Author/generate/automake_app/configure.ac @@ -80,6 +80,9 @@ if test -x "$NODE"; then v13*) AC_MSG_RESULT(ok v13) ;; + v14*) + AC_MSG_RESULT(ok v14) + ;; *) AC_MSG_RESULT(no); NODE=old-node From f4931f853ad8755ecc3a0939d2f7e52c820ea317 Mon Sep 17 00:00:00 2001 From: Zakariyya Mughal Date: Tue, 7 Sep 2021 04:17:06 -0400 Subject: [PATCH 10/15] Add missing files to MANIFEST --- MANIFEST | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MANIFEST b/MANIFEST index 5ad00b7..3dfd340 100644 --- a/MANIFEST +++ b/MANIFEST @@ -23,9 +23,12 @@ lib/Mojolicious/Command/Author/generate/automake_app/lib/Makefile.am lib/Mojolicious/Command/Author/generate/automake_app/configure.ac lib/Mojolicious/Command/Author/generate/automake_app/VERSION lib/Mojolicious/Command/Author/generate/automake_app/thirdparty/Makefile.am +lib/Mojolicious/Command/Author/generate/automake_app/public/index.html lib/Mojolicious/Command/Author/generate/automake_app/templates/example/welcome.html.ep lib/Mojolicious/Command/Author/generate/automake_app/templates/layouts/default.html.ep lib/Mojolicious/Command/Author/generate/automake_app/LICENSE +lib/Mojolicious/Command/Author/generate/automake_app/t/basic.t +lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/unit-tests.yaml lib/Mojolicious/Command/Author/generate/automake_app.pm lib/Mojolicious/Command/Author/generate/callbackery_app/.gitignore lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Manifest.json @@ -46,5 +49,6 @@ lib/Mojolicious/Command/Author/generate/callbackery_app/lib/App.pm lib/Mojolicious/Command/Author/generate/callbackery_app/bin/source-mode.sh lib/Mojolicious/Command/Author/generate/callbackery_app/bin/app.pl lib/Mojolicious/Command/Author/generate/callbackery_app/etc/app.dist.yaml +lib/Mojolicious/Command/Author/generate/callbackery_app/etc/Makefile.am lib/Mojolicious/Command/Author/generate/callbackery_app/README.md lib/Mojolicious/Command/Author/generate/callbackery_app.pm From ba24533fbad92c672be75578fbe356e9519e8943 Mon Sep 17 00:00:00 2001 From: Tobias Oetiker Date: Tue, 7 Sep 2021 10:20:02 +0200 Subject: [PATCH 11/15] Update unit-tests.yml --- .github/workflows/unit-tests.yml | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index b4f6a3c..76b7f48 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -15,33 +15,23 @@ jobs: strategy: matrix: os: - - ubuntu-16.04 - ubuntu-18.04 + - ubuntu-20.04 # no libssl on windows # - windows-latest perl: - - '5.22' - '5.26' - '5.30' - + - '5.32' + - '5.34' node: - '10.x' - - '13.x' - + - '14.x' + - '16.x' exclude: - - os: ubuntu-16.04 - perl: '5.26' - - os: ubuntu-16.04 - perl: '5.30' - - os: ubuntu-16.04 - node: '13.x' - os: ubuntu-18.04 perl: '5.22' - - os: windows-latest - perl: '5.22' - - os: windows-latest - perl: '5.26' fail-fast: false From dfe9f533257f10c5a1c6691a34e924919b3b957c Mon Sep 17 00:00:00 2001 From: Tobias Oetiker Date: Tue, 7 Sep 2021 10:21:41 +0200 Subject: [PATCH 12/15] Update configure.ac --- .../Command/Author/generate/automake_app/configure.ac | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/configure.ac b/lib/Mojolicious/Command/Author/generate/automake_app/configure.ac index d500cd1..f3b0ffc 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app/configure.ac +++ b/lib/Mojolicious/Command/Author/generate/automake_app/configure.ac @@ -71,18 +71,15 @@ if test -x "$NODE"; then v10*) AC_MSG_RESULT(ok v10) ;; - v11*) - AC_MSG_RESULT(ok v11) - ;; v12*) AC_MSG_RESULT(ok v12) ;; - v13*) - AC_MSG_RESULT(ok v13) - ;; v14*) AC_MSG_RESULT(ok v14) ;; + v16*) + AC_MSG_RESULT(ok v16) + ;; *) AC_MSG_RESULT(no); NODE=old-node From f7b4ec1f27cd6e4fd0d2692a508eb6e761c6c604 Mon Sep 17 00:00:00 2001 From: Tobias Oetiker Date: Tue, 7 Sep 2021 10:22:38 +0200 Subject: [PATCH 13/15] Update unit-tests.yaml --- .../automake_app/.github/workflows/unit-tests.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/unit-tests.yaml b/lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/unit-tests.yaml index 8f82bfc..15a759f 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/unit-tests.yaml +++ b/lib/Mojolicious/Command/Author/generate/automake_app/.github/workflows/unit-tests.yaml @@ -17,6 +17,7 @@ jobs: os: # - ubuntu-16.04 - ubuntu-18.04 + - ubuntu-20.04 # no libssl on windows # - windows-latest @@ -24,10 +25,13 @@ jobs: # - '5.22' - '5.26' - '5.30' + - '5.32' + - '5.34' % if ($package eq 'callbackery' ) { node: # - '10.x' - - '13.x' + - '14.x' + - '16.x' % } # exclude: #- os: ubuntu-16.04 @@ -131,4 +135,4 @@ jobs: - name: Cache Prep run: | rm thirdparty/Makefile* thirdparty/cpan*snapshot - \ No newline at end of file + From 6d10f216b242e1ad6e8090919388fa3d25777843 Mon Sep 17 00:00:00 2001 From: Tobias Oetiker Date: Tue, 7 Sep 2021 10:23:06 +0200 Subject: [PATCH 14/15] Update lib/Mojolicious/Command/Author/generate/automake_app/.gitignore --- lib/Mojolicious/Command/Author/generate/automake_app/.gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Mojolicious/Command/Author/generate/automake_app/.gitignore b/lib/Mojolicious/Command/Author/generate/automake_app/.gitignore index f8a1666..35cc824 100644 --- a/lib/Mojolicious/Command/Author/generate/automake_app/.gitignore +++ b/lib/Mojolicious/Command/Author/generate/automake_app/.gitignore @@ -42,4 +42,4 @@ frontend/qx_packages/ /configure debian/.debhelper debian/files -debian/<%= ${class} %>.* \ No newline at end of file +debian/<%= ${class} %>.* From 3e70e52df105fbfbab94ad14fd210cf24c104377 Mon Sep 17 00:00:00 2001 From: Fritz Zaucker Date: Tue, 2 Aug 2022 11:36:50 +0200 Subject: [PATCH 15/15] Add DATE/YEAR env variable to frontend/Makefile.am --- .../Author/generate/callbackery_app/frontend/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Makefile.am b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Makefile.am index fc33a8e..20d90bb 100644 --- a/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Makefile.am +++ b/lib/Mojolicious/Command/Author/generate/callbackery_app/frontend/Makefile.am @@ -21,6 +21,9 @@ source-watch: node_modules build: ../public/.built +YEAR := $(shell date +%Y) +DATE := $(shell date +%Y-%m-%d) + dist-hook: $(PERL) -i -p -e 's/#VERSION#/$(PACKAGE_VERSION)/g;s/#YEAR#/$(YEAR)/g;s/#DATE#/$(DATE)/g;' $(distdir)/../public/$(QX_CLASS)/*.js