Skip to content

Commit

Permalink
refactor build environment
Browse files Browse the repository at this point in the history
  • Loading branch information
haru committed Jan 19, 2024
1 parent ac6d5ea commit 86710fa
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// https://github.com/microsoft/vscode-dev-containers/tree/v0.202.5/containers/ruby-rails-postgres
// Update the VARIANT arg in docker-compose.yml to pick a Ruby version
{
"name": "Ruby on Rails & Postgres",
"name": "Redmine plugin",
"dockerComposeFile": "docker-compose.yml",
"service": "app",

Expand Down
14 changes: 14 additions & 0 deletions .devcontainer/plugin_generator.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
set -e

cd `dirname $0`
cd ..
BASEDIR=`pwd`
PLUGIN_NAME=`basename $BASEDIR`
echo $PLUGIN_NAME

cd $REDMINE_ROOT

export RAILS_ENV="production"

bundle exec rails generate redmine_plugin $PLUGIN_NAME
3 changes: 1 addition & 2 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!/bin/sh
cd /usr/local/redmine
cd $REDMINE_ROOT

ln -s /workspaces/${PLUGIN_NAME} plugins/${PLUGIN_NAME}
if [ -f plugins/${PLUGIN_NAME}/Gemfile_for_test ]
then
cp plugins/${PLUGIN_NAME}/Gemfile_for_test plugins/${PLUGIN_NAME}/Gemfile
fi

ln -s /workspaces/${PLUGIN_NAME}/.devcontainer/launch.json .vscode/launch.json

bundle install
bundle exec rake redmine:plugins:migrate
Expand Down
11 changes: 11 additions & 0 deletions .devcontainer/redmine.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"folders": [
{
"path": ".."
},
{
"path": "../../../usr/local/redmine"
}
],
"settings": {}
}
26 changes: 6 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
- '**'
tags:
- '**'
permissions:
contents: write
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
jobs:
Expand All @@ -23,24 +25,8 @@ jobs:
- name: Archive
run: |
cd ..; zip -r ${{ env.filename }}.zip ${{ env.plugin }}/ -x "*.git*"; mv ${{ env.filename }}.zip ${{ env.plugin }}/
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.version }}
release_name: ${{ env.version }}
body: ''
draft: false
prerelease: true
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.filename }}.zip
asset_name: ${{ env.filename }}.zip
asset_content_type: application/zip
draft: true
files: ${{ env.filename }}.zip
11 changes: 0 additions & 11 deletions .redmine.code-workspace

This file was deleted.

0 comments on commit 86710fa

Please sign in to comment.