-
Notifications
You must be signed in to change notification settings - Fork 503
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into USH-1097
- Loading branch information
Showing
27 changed files
with
397 additions
and
91 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: 'Release tar' | ||
description: Build and upload a tarball to GitHub releases | ||
# inputs: | ||
# version: | ||
# description: 'Version to release' | ||
# required: true | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- name: Set version number | ||
id: version | ||
shell: bash | ||
run: | | ||
RELEASE_VERSION="${GITHUB_REF##*/}"; | ||
RELEASE_FILE="ushahidi-platform-bundle-${RELEASE_VERSION}.tar.gz" | ||
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_OUTPUT | ||
echo "RELEASE_FILE=${RELEASE_FILE}" >> $GITHUB_OUTPUT | ||
- name: Build image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
push: false | ||
load: true | ||
tags: local/platform:latest | ||
build-args: | | ||
GIT_COMMIT_ID=${{ github.sha }} | ||
GIT_BUILD_REF=${{ github.head_ref }} | ||
- name: Prepare folder | ||
shell: bash | ||
run: | ||
mkdir -p tmp/out | ||
|
||
- name: Create release file | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: local/platform:latest | ||
run: docker/release.sh ${{ steps.version.outputs.RELEASE_VERSION }} | ||
options: | | ||
--entrypoint /bin/bash | ||
-v ${{ github.workspace }}/tmp/out:/var/www/build | ||
- name: List release content | ||
shell: bash | ||
run: | | ||
tar -tvf tmp/out/${{ steps.version.outputs.RELEASE_FILE }}; | ||
- name: Upload tarball | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
draft: true | ||
files: | | ||
tmp/out/${{ steps.version.outputs.RELEASE_FILE }} |
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
65 changes: 65 additions & 0 deletions
65
database/migrations/phinx/20240213065807_add_missing_admin_permissions.php
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,65 @@ | ||
<?php | ||
|
||
|
||
use Phinx\Migration\AbstractMigration; | ||
|
||
class AddMissingAdminPermissions extends AbstractMigration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
$this->execute("INSERT INTO `roles_permissions` (`role`, `permission`) | ||
VALUES ('admin', 'Manage Users')"); | ||
|
||
$this->execute("INSERT INTO `roles_permissions` (`role`, `permission`) | ||
VALUES ('admin', 'Manage Posts')"); | ||
|
||
$this->execute("INSERT INTO `roles_permissions` (`role`, `permission`) | ||
VALUES ('admin', 'Manage Settings')"); | ||
|
||
$this->execute("INSERT INTO `roles_permissions` (`role`, `permission`) | ||
VALUES ('admin', 'Bulk Data Import and Export')"); | ||
|
||
$this->execute("INSERT INTO `roles_permissions` (`role`, `permission`) | ||
VALUES ('admin', 'Edit their own posts')"); | ||
|
||
$this->execute("INSERT INTO `roles_permissions` (`role`, `permission`) | ||
VALUES ('admin', 'Delete Posts')"); | ||
|
||
$this->execute("INSERT INTO `roles_permissions` (`role`, `permission`) | ||
VALUES ('admin', 'Delete Their Own Posts')"); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
$this->execute("DELETE FROM roles_permissions | ||
WHERE permission = 'Manage Users'"); | ||
|
||
$this->execute("DELETE FROM roles_permissions | ||
WHERE permission = 'Manage Posts'"); | ||
|
||
$this->execute("DELETE FROM roles_permissions | ||
WHERE permission = 'Manage Settings'"); | ||
|
||
$this->execute("DELETE FROM roles_permissions | ||
WHERE permission = 'Bulk Data Import and Export'"); | ||
|
||
$this->execute("DELETE FROM roles_permissions | ||
WHERE permission = 'Edit their own posts'"); | ||
|
||
$this->execute("DELETE FROM roles_permissions | ||
WHERE permission = 'Delete Posts'"); | ||
|
||
$this->execute("DELETE FROM roles_permissions | ||
WHERE permission = 'Delete Their Own Posts'"); | ||
} | ||
} |
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,55 @@ | ||
#!/bin/bash | ||
|
||
# if someone invokes this with bash | ||
set -e | ||
|
||
# build release tarball | ||
usage() { | ||
echo usage: $0 VERSION | ||
exit 2 | ||
} | ||
|
||
test $# -eq 1 || usage | ||
VERSION=$1 | ||
CWD=$(pwd) | ||
|
||
# Install composer dependencies (with autoload file generation enabled) | ||
composer install --no-scripts; | ||
|
||
TMP_DIR=$(mktemp -d 2>/dev/null || mktemp -d -t platform-build) | ||
WORK_DIR=$TMP_DIR/ushahidi-platform-bundle-${VERSION} | ||
mkdir $WORK_DIR | ||
|
||
if [ -z "$DEST_DIR" ]; then | ||
DEST_DIR="${CWD}/build" | ||
fi | ||
|
||
echo "Copy to temp dir" | ||
cp -R ./ $WORK_DIR | ||
|
||
# Tar it up. | ||
echo "Building tarball" | ||
if [ ! -d "$DEST_DIR" ]; then | ||
mkdir -p "$DEST_DIR" | ||
fi | ||
TARFILE="${DEST_DIR}/ushahidi-platform-bundle-${VERSION}.tar" | ||
|
||
tar -C $TMP_DIR -cf $TARFILE \ | ||
--exclude 'build' \ | ||
--exclude 'docs' \ | ||
--exclude 'storage/logs/*' \ | ||
--exclude '.travis.yml' \ | ||
--exclude '.vagrant' \ | ||
--exclude 'tmp' \ | ||
--exclude '.env' \ | ||
--exclude '.env.travis' \ | ||
--exclude '.git' \ | ||
--exclude '.gitbook' \ | ||
ushahidi-platform-bundle-${VERSION}/ | ||
|
||
gzip -f $TARFILE | ||
echo "Release tarball: ${TARFILE}.gz" | ||
|
||
ls -la ${TARFILE}.gz | ||
|
||
rm -rf $TMP_DIR |
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
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
Oops, something went wrong.