Make preparations for first upgrade release
- Create `CHANGELOG.txt` file - Bump ENGINE_DATABASE_VERSION - Add an upgrade-testing step to the CI build
This commit is contained in:
parent
28e44897b5
commit
9357974a29
27
.build.yml
27
.build.yml
@ -95,6 +95,33 @@ tasks:
|
||||
duration=$SECONDS
|
||||
echo "Task completed in $(($duration / 60))m$(($duration % 60))s."
|
||||
|
||||
- version_bump_test: |
|
||||
SECONDS=0
|
||||
|
||||
sudo apt install -y curl gnupg
|
||||
sudo curl https://apt.playfulpachyderm.com/KEY.gpg | apt-key add -
|
||||
sudo echo "deb https://apt.playfulpachyderm.com/ ./" > /etc/apt/sources.list.d/offline_twitter.list
|
||||
sudo apt update
|
||||
|
||||
sudo apt install -y offline-twitter-engine # Latest released version
|
||||
which twitter # Ensure that it got installed
|
||||
|
||||
cd twitter_offline_engine/cmd
|
||||
twitter create_profile outdated_profile
|
||||
cd outdated_profile
|
||||
|
||||
# Create some sample data
|
||||
twitter fetch_user michaelmalice
|
||||
twitter get_user_tweets michaelmalice
|
||||
|
||||
# Now test the upgrade using the newer version
|
||||
cd .. # Now in `cmd` directory
|
||||
which ./tw # Should be here from previous step
|
||||
tw fetch_user michaelmalice # Any operation other than `create_profile` should trigger the upgrade
|
||||
|
||||
duration=$SECONDS
|
||||
echo "Task completed in $(($duration / 60))m$(($duration % 60))s."
|
||||
|
||||
- dpkg_build_and_upload: |
|
||||
SECONDS=0
|
||||
|
||||
|
12
CHANGELOG.txt
Normal file
12
CHANGELOG.txt
Normal file
@ -0,0 +1,12 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
v0.0.0
|
||||
------
|
||||
|
||||
- Initial release.
|
||||
|
||||
v0.0.1
|
||||
------
|
||||
|
||||
- Added polls
|
@ -35,8 +35,8 @@ Section: web
|
||||
Priority: optional
|
||||
Homepage: http://offline-twitter.com
|
||||
Description: This utility is the scraper engine that drives \`offline-twitter\`.
|
||||
Download and browse content from twitter.
|
||||
Save a local copy of everything you browse to a SQLite database.
|
||||
Download and browse content from twitter. Everything you browse gets saved as
|
||||
a local copy into a SQLite database on your computer.
|
||||
" > dpkg_tmp/DEBIAN/control
|
||||
|
||||
|
||||
|
@ -111,8 +111,8 @@ func TestNewProfile(t *testing.T) {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if version != 0 {
|
||||
t.Errorf("Expected database version %d, but got %d", 0, version)
|
||||
if version != persistence.ENGINE_DATABASE_VERSION {
|
||||
t.Errorf("Expected database version %d, but got %d", persistence.ENGINE_DATABASE_VERSION, version)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
|
||||
const ENGINE_DATABASE_VERSION = 0
|
||||
const ENGINE_DATABASE_VERSION = 1
|
||||
|
||||
|
||||
type VersionMismatchError struct {
|
||||
@ -26,7 +26,27 @@ Please upgrade this application to a newer version to use this profile. Or down
|
||||
* The Nth entry is the migration that moves you from version N to version N+1
|
||||
*/
|
||||
var MIGRATIONS = []string{
|
||||
`create table polls (rowid integer primary key,
|
||||
id integer unique not null check(typeof(id) = 'integer'),
|
||||
tweet_id integer not null,
|
||||
num_choices integer not null,
|
||||
|
||||
choice1 text,
|
||||
choice1_votes integer,
|
||||
choice2 text,
|
||||
choice2_votes integer,
|
||||
choice3 text,
|
||||
choice3_votes integer,
|
||||
choice4 text,
|
||||
choice4_votes integer,
|
||||
|
||||
voting_duration integer not null, -- in seconds
|
||||
voting_ends_at integer not null,
|
||||
|
||||
last_scraped_at integer not null,
|
||||
|
||||
foreign key(tweet_id) references tweets(id)
|
||||
);`,
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user